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

Function OnMiscompare

tensorflow/compiler/xla/tests/literal_test_util.cc:51–62  ·  view source on GitHub ↗

Callback helper that dumps literals to temporary files in the event of a miscomparison.

Source from the content-addressed store, hash-verified

49// Callback helper that dumps literals to temporary files in the event of a
50// miscomparison.
51void OnMiscompare(const LiteralSlice& expected, const LiteralSlice& actual,
52 const LiteralSlice& mismatches,
53 const ShapeIndex& /*shape_index*/) {
54 LOG(INFO) << "expected: " << ShapeUtil::HumanString(expected.shape()) << " "
55 << literal_comparison::ToStringTruncated(expected);
56 LOG(INFO) << "actual: " << ShapeUtil::HumanString(actual.shape()) << " "
57 << literal_comparison::ToStringTruncated(actual);
58 LOG(INFO) << "Dumping literals to temp files...";
59 WriteLiteralToTempFile(expected, "expected");
60 WriteLiteralToTempFile(actual, "actual");
61 WriteLiteralToTempFile(mismatches, "mismatches");
62}
63
64::testing::AssertionResult StatusToAssertion(const Status& s) {
65 if (s.ok()) {

Callers

nothing calls this directly

Calls 3

ToStringTruncatedFunction · 0.85
WriteLiteralToTempFileFunction · 0.85
shapeMethod · 0.45

Tested by

no test coverage detected