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

Method RunAndCompareInternal

tensorflow/compiler/xla/tests/hlo_test_base.cc:239–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239StatusOr<::testing::AssertionResult> HloTestBase::RunAndCompareInternal(
240 std::unique_ptr<HloModule> module,
241 const absl::Span<Literal* const> arguments,
242 const optional<ErrorSpec>& error, bool run_hlo_passes,
243 const std::function<void(HloModule*)>& reference_preprocessor) {
244 TF_RETURN_IF_ERROR(hlo_verifier_->Run(module.get()).status());
245 TF_ASSIGN_OR_RETURN(auto reference_module,
246 MakeReferenceModule(*module, reference_preprocessor));
247
248 // Execute on two backends.
249 TF_ASSIGN_OR_RETURN(
250 auto test,
251 test_runner_.Execute(std::move(module), arguments, run_hlo_passes));
252 TF_ASSIGN_OR_RETURN(auto reference,
253 reference_runner_.Execute(std::move(reference_module),
254 arguments, run_hlo_passes));
255 return LiteralTestUtil::NearOrEqual(/*expected=*/reference, /*actual=*/test,
256 error);
257}
258
259::testing::AssertionResult HloTestBase::RunAndCompare(
260 std::unique_ptr<HloModule> module,

Callers

nothing calls this directly

Calls 3

statusMethod · 0.45
RunMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected