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

Method Tuple

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

Source from the content-addressed store, hash-verified

1076}
1077
1078XlaOp XlaBuilder::Tuple(absl::Span<const XlaOp> elements) {
1079 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
1080 HloInstructionProto instr;
1081 std::vector<const Shape*> operand_shape_ptrs;
1082 TF_ASSIGN_OR_RETURN(const auto& operand_shapes, GetOperandShapes(elements));
1083 absl::c_transform(operand_shapes, std::back_inserter(operand_shape_ptrs),
1084 [](const Shape& shape) { return &shape; });
1085 TF_ASSIGN_OR_RETURN(const Shape shape,
1086 ShapeInference::InferVariadicOpShape(
1087 HloOpcode::kTuple, operand_shape_ptrs));
1088 *instr.mutable_shape() = shape.ToProto();
1089 return AddInstruction(std::move(instr), HloOpcode::kTuple, elements);
1090 });
1091}
1092
1093XlaOp XlaBuilder::GetTupleElement(XlaOp tuple_data, int64 index) {
1094 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {

Callers 5

core.pyFile · 0.45
ops.pyFile · 0.45
visit_IfMethod · 0.45
_loop_var_constructsMethod · 0.45
TupleFunction · 0.45

Calls 2

mutable_shapeMethod · 0.45
ToProtoMethod · 0.45

Tested by

no test coverage detected