MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _VerifyFftMethod

Method _VerifyFftMethod

tensorflow/compiler/tests/fft_test.py:62–79  ·  view source on GitHub ↗
(self, inner_dims, complex_to_input, input_to_expected,
                       tf_method)

Source from the content-addressed store, hash-verified

60class FFTTest(xla_test.XLATestCase):
61
62 def _VerifyFftMethod(self, inner_dims, complex_to_input, input_to_expected,
63 tf_method):
64 for indims in inner_dims:
65 print("nfft =", indims)
66 shape = BATCH_DIMS + indims
67 data = np.arange(np.prod(shape) * 2) / np.prod(indims)
68 np.random.seed(123)
69 np.random.shuffle(data)
70 data = np.reshape(data.astype(np.float32).view(np.complex64), shape)
71 data = to_32bit(complex_to_input(data))
72 expected = to_32bit(input_to_expected(data))
73 with self.session() as sess:
74 with self.test_scope():
75 ph = array_ops.placeholder(
76 dtypes.as_dtype(data.dtype), shape=data.shape)
77 out = tf_method(ph)
78 value = sess.run(out, {ph: data})
79 self.assertAllClose(expected, value, rtol=RTOL, atol=ATOL)
80
81 def testContribSignalSTFT(self):
82 ws = 512

Callers 14

testFFTMethod · 0.95
testFFT2DMethod · 0.95
testFFT3DMethod · 0.95
testIFFTMethod · 0.95
testIFFT2DMethod · 0.95
testIFFT3DMethod · 0.95
testRFFTMethod · 0.95
testRFFT2DMethod · 0.95
testRFFT3DMethod · 0.95
testIRFFTMethod · 0.95
testIRFFT2DMethod · 0.95

Calls 9

to_32bitFunction · 0.85
reshapeMethod · 0.80
seedMethod · 0.45
shuffleMethod · 0.45
sessionMethod · 0.45
test_scopeMethod · 0.45
placeholderMethod · 0.45
runMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected