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

Method Parameter

tensorflow/compiler/xla/client/xla_builder.cc:712–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712XlaOp XlaBuilder::Parameter(
713 int64 parameter_number, const Shape& shape, const string& name,
714 const std::vector<bool>& replicated_at_leaf_buffers) {
715 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
716 HloInstructionProto instr;
717 if (!parameter_numbers_.insert(parameter_number).second) {
718 return InvalidArgument("parameter %d already registered",
719 parameter_number);
720 }
721 instr.set_parameter_number(parameter_number);
722 instr.set_name(name);
723 *instr.mutable_shape() = shape.ToProto();
724 if (!replicated_at_leaf_buffers.empty()) {
725 auto replication = instr.mutable_parameter_replication();
726 for (bool replicated : replicated_at_leaf_buffers) {
727 replication->add_replicated_at_leaf_buffers(replicated);
728 }
729 }
730 return AddInstruction(std::move(instr), HloOpcode::kParameter);
731 });
732}
733
734XlaOp XlaBuilder::Broadcast(XlaOp operand,
735 absl::Span<const int64> broadcast_sizes) {

Callers 3

CrossReplicaSumMethod · 0.45
ParameterFunction · 0.45
ParameterWithShapeMethod · 0.45

Calls 6

InvalidArgumentFunction · 0.85
insertMethod · 0.45
set_nameMethod · 0.45
mutable_shapeMethod · 0.45
ToProtoMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected