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

Function CompareComplexData

tensorflow/core/kernels/spectrogram_test.cc:157–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156template <class ExpectedSample, class ActualSample>
157void CompareComplexData(
158 const std::vector<std::vector<complex<ExpectedSample>>>& expected,
159 const std::vector<std::vector<complex<ActualSample>>>& actual,
160 double tolerance) {
161 ASSERT_EQ(actual.size(), expected.size());
162 for (int i = 0; i < expected.size(); ++i) {
163 ASSERT_EQ(expected[i].size(), actual[i].size());
164 for (int j = 0; j < expected[i].size(); ++j) {
165 ASSERT_NEAR(real(expected[i][j]), real(actual[i][j]), tolerance)
166 << ": where i=" << i << " and j=" << j << ".";
167 ASSERT_NEAR(imag(expected[i][j]), imag(actual[i][j]), tolerance)
168 << ": where i=" << i << " and j=" << j << ".";
169 }
170 }
171}
172
173template <class Sample>
174double GetMaximumAbsolute(const std::vector<std::vector<Sample>>& spectrogram) {

Callers 1

TESTFunction · 0.85

Calls 3

realFunction · 0.85
imagFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected