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

Function TensorsAreEqualImpl

tensorflow/compiler/tests/randomized_tests.cc:766–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764
765template <typename T>
766Status TensorsAreEqualImpl(const Tensor& x, const Tensor& y) {
767 auto Tx = x.flat<T>();
768 auto Ty = y.flat<T>();
769 for (int i = 0; i < Tx.size(); ++i) {
770 if (Tx(i) != Ty(i)) {
771 return errors::InvalidArgument(absl::StrCat(
772 i, "-th tensor element isn't equal: ", Str(Tx(i)), " vs. ",
773 Str(Ty(i)), ". x = ", x.DebugString(), "y = ", y.DebugString()));
774 }
775 }
776 return Status::OK();
777}
778
779Status TensorsAreEqualImplBfloat16(const Tensor& x, const Tensor& y) {
780 auto Tx = x.flat<bfloat16>();

Callers

nothing calls this directly

Calls 5

InvalidArgumentFunction · 0.85
StrFunction · 0.85
StrCatFunction · 0.50
sizeMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected