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

Function IsClose

tensorflow/compiler/tests/randomized_tests.cc:716–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714
715template <typename T>
716bool IsClose(const T& x, const T& y, double atol, double rtol) {
717 if (std::isnan(x) && std::isnan(y)) return true;
718 if (x == y) return true; // Allow inf == inf.
719 return Abs(x - y) < atol + rtol * Abs(x);
720}
721
722template <>
723bool IsClose<complex64>(const complex64& x, const complex64& y, double atol,

Callers 6

TensorsAreCloseImplFunction · 0.85
ExpectNearMethod · 0.85
TestEdgeCasesCloseFunction · 0.85
TESTFunction · 0.85
ExpectCloseFunction · 0.85
IsCloseMethod · 0.85

Calls 2

isnanClass · 0.85
AbsFunction · 0.70

Tested by

no test coverage detected