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

Function CheckCallLayout

tensorflow/compiler/xla/service/layout_assignment.cc:678–689  ·  view source on GitHub ↗

The operands of a call must match the layouts of parameters in the ComputationLayout, and the call instruction itself must match the result layout in the ComputationLayout.

Source from the content-addressed store, hash-verified

676// ComputationLayout, and the call instruction itself must match the result
677// layout in the ComputationLayout.
678Status CheckCallLayout(HloInstruction* call,
679 const ComputationLayout& computation_layout) {
680 HloComputation* computation = call->to_apply();
681 TF_RET_CHECK(computation->num_parameters() == call->operand_count());
682 for (int64 i = 0; i < computation->num_parameters(); ++i) {
683 TF_RET_CHECK(computation_layout.parameter_layout(i).MatchesLayoutInShape(
684 call->operand(i)->shape(), /*minor_to_major_only=*/true));
685 }
686 TF_RET_CHECK(computation_layout.result_layout().MatchesLayoutInShape(
687 call->shape(), /*minor_to_major_only=*/true));
688 return Status::OK();
689}
690
691// Operands of layout-constrained custom calls must match the expected
692// constrained layouts.

Callers 1

CheckLayoutsMethod · 0.85

Calls 7

to_applyMethod · 0.80
num_parametersMethod · 0.80
operand_countMethod · 0.80
MatchesLayoutInShapeMethod · 0.80
result_layoutMethod · 0.80
shapeMethod · 0.45
operandMethod · 0.45

Tested by

no test coverage detected