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

Function CompareMagnitudeData

tensorflow/core/kernels/spectrogram_test.cc:188–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187template <class ExpectedSample, class ActualSample>
188void CompareMagnitudeData(
189 const std::vector<std::vector<complex<ExpectedSample>>>&
190 expected_complex_output,
191 const std::vector<std::vector<ActualSample>>& actual_squared_magnitude,
192 double tolerance) {
193 ASSERT_EQ(actual_squared_magnitude.size(), expected_complex_output.size());
194 for (int i = 0; i < expected_complex_output.size(); ++i) {
195 ASSERT_EQ(expected_complex_output[i].size(),
196 actual_squared_magnitude[i].size());
197 for (int j = 0; j < expected_complex_output[i].size(); ++j) {
198 ASSERT_NEAR(norm(expected_complex_output[i][j]),
199 actual_squared_magnitude[i][j], tolerance)
200 << ": where i=" << i << " and j=" << j << ".";
201 }
202 }
203}
204
205TEST(SpectrogramTest, ReInitializationWorks) {
206 Spectrogram sgram;

Callers 1

TESTFunction · 0.85

Calls 2

normFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected