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

Method AddCopyForOperand

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

Source from the content-addressed store, hash-verified

2327}
2328
2329Status LayoutAssignment::AddCopyForOperand(HloInstruction* instruction,
2330 int64 operand_number) {
2331 HloInstruction* operand = instruction->mutable_operand(operand_number);
2332 if (operand->opcode() != HloOpcode::kCopy || operand->user_count() > 1) {
2333 HloInstruction* copy =
2334 instruction->parent()->AddInstruction(HloInstruction::CreateUnary(
2335 operand->shape(), HloOpcode::kCopy, operand));
2336 SetupCopiedInstruction(*operand, copy, {});
2337 LayoutUtil::ClearLayout(copy->mutable_shape());
2338 TF_RETURN_IF_ERROR(instruction->ReplaceOperandWith(operand_number, copy));
2339 }
2340 return Status::OK();
2341}
2342
2343} // namespace xla

Callers

nothing calls this directly

Calls 8

mutable_operandMethod · 0.80
opcodeMethod · 0.80
user_countMethod · 0.80
ReplaceOperandWithMethod · 0.80
AddInstructionMethod · 0.45
parentMethod · 0.45
shapeMethod · 0.45
mutable_shapeMethod · 0.45

Tested by

no test coverage detected