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

Method MakeReferenceModule

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

Source from the content-addressed store, hash-verified

219}
220
221StatusOr<std::unique_ptr<HloModule>> HloTestBase::MakeReferenceModule(
222 const HloModule& test_module,
223 const std::function<void(HloModule*)>& reference_preprocessor) {
224 std::unique_ptr<HloModule> reference_module = test_module.Clone();
225 const auto& program_shape = GetProgramShapeWithLayout(test_module);
226
227 if (reference_preprocessor != nullptr) {
228 reference_preprocessor(reference_module.get());
229 if (!ProgramShapesEqual(program_shape,
230 GetProgramShapeWithLayout(*reference_module))) {
231 return InvalidArgument(
232 "reference preprocessor must not modify the program shape");
233 }
234 }
235 TF_RETURN_IF_ERROR(hlo_verifier_->Run(reference_module.get()).status());
236 return std::move(reference_module);
237}
238
239StatusOr<::testing::AssertionResult> HloTestBase::RunAndCompareInternal(
240 std::unique_ptr<HloModule> module,

Callers

nothing calls this directly

Calls 7

ProgramShapesEqualFunction · 0.85
InvalidArgumentFunction · 0.85
CloneMethod · 0.45
getMethod · 0.45
statusMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected