예제 #1
0
 def test_unknown_shape(self):
     """A test that the op runs when shape and rank are unknown."""
     with self.session(use_gpu=True):
         signal = array_ops.placeholder_with_default(
             random_ops.random_normal((2, 3, 5)),
             tensor_shape.TensorShape(None))
         self.assertIsNone(signal.shape.ndims)
         mfcc_ops.mfccs_from_log_mel_spectrograms(signal).eval()
예제 #2
0
 def test_unknown_shape(self):
   """A test that the op runs when shape and rank are unknown."""
   with spectral_ops_test_util.fft_kernel_label_map():
     with self.session(use_gpu=True):
       signal = array_ops.placeholder_with_default(
           random_ops.random_normal((2, 3, 5)), tensor_shape.TensorShape(None))
       self.assertIsNone(signal.shape.ndims)
       mfcc_ops.mfccs_from_log_mel_spectrograms(signal).eval()
예제 #3
0
  def test_error(self):
    # num_mel_bins must be positive.
    with self.assertRaises(ValueError):
      signal = array_ops.zeros((2, 3, 0))
      mfcc_ops.mfccs_from_log_mel_spectrograms(signal)

    # signal must be float32
    with self.assertRaises(ValueError):
      signal = array_ops.zeros((2, 3, 5), dtype=dtypes.float64)
      mfcc_ops.mfccs_from_log_mel_spectrograms(signal)
예제 #4
0
    def test_error(self):
        # num_mel_bins must be positive.
        with self.assertRaises(ValueError):
            signal = array_ops.zeros((2, 3, 0))
            mfcc_ops.mfccs_from_log_mel_spectrograms(signal)

        # signal must be float32
        with self.assertRaises(ValueError):
            signal = array_ops.zeros((2, 3, 5), dtype=dtypes.float64)
            mfcc_ops.mfccs_from_log_mel_spectrograms(signal)
예제 #5
0
 def test_unknown_shape(self):
   """A test that the op runs when shape and rank are unknown."""
   if context.executing_eagerly():
     return
   signal = array_ops.placeholder_with_default(
       random_ops.random_normal((2, 3, 5)), tensor_shape.TensorShape(None))
   self.assertIsNone(signal.shape.ndims)
   self.evaluate(mfcc_ops.mfccs_from_log_mel_spectrograms(signal))
예제 #6
0
 def test_basic(self):
   """A basic test that the op runs on random input."""
   with spectral_ops_test_util.fft_kernel_label_map():
     with self.session(use_gpu=True):
       signal = random_ops.random_normal((2, 3, 5))
       mfcc_ops.mfccs_from_log_mel_spectrograms(signal).eval()
예제 #7
0
 def test_basic(self, dtype):
   """A basic test that the op runs on random input."""
   signal = random_ops.random_normal((2, 3, 5), dtype=dtype)
   self.evaluate(mfcc_ops.mfccs_from_log_mel_spectrograms(signal))
 def test_basic(self, dtype):
     """A basic test that the op runs on random input."""
     with compat.forward_compatibility_horizon(2019, 10, 13):
         signal = random_ops.random_normal((2, 3, 5), dtype=dtype)
         self.evaluate(mfcc_ops.mfccs_from_log_mel_spectrograms(signal))
예제 #9
0
 def test_basic(self):
     """A basic test that the op runs on random input."""
     with spectral_ops_test_util.fft_kernel_label_map():
         with self.session(use_gpu=True):
             signal = random_ops.random_normal((2, 3, 5))
             mfcc_ops.mfccs_from_log_mel_spectrograms(signal).eval()