Skip to content

Commit

Permalink
[XLA] Use assertion_result instead of LOG(ERROR) in HloTestBase::Prin…
Browse files Browse the repository at this point in the history
…tLiteral.

This puts the actual problem at the beginning of the debug spew, and the maybe-relevant data afterwards.

PiperOrigin-RevId: 675093209
  • Loading branch information
chsigg authored and Google-ML-Automation committed Sep 16, 2024
1 parent e438de6 commit f73ec40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xla/tests/hlo_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ ::testing::AssertionResult HloTestBase::RunAndCompareNoHloPasses(
absl::c_for_each(literal.shape().dimensions(),
[&](int64_t dim) { total_elements *= dim; });
if (total_elements > 1000) {
LOG(ERROR) << "argument literal is too large to print: "
<< literal.shape().ToString();
assertion_result << "argument literal is too large to print: "
<< literal.shape().ToString();
continue;
}
LOG(ERROR) << "argument literal: " << literal.ToString();
assertion_result << "argument literal: " << literal.ToString();
}
}
return assertion_result;
Expand Down

0 comments on commit f73ec40

Please sign in to comment.