| 1056 | } |
| 1057 | |
| 1058 | void XlaBuilder::Trace(const string& tag, XlaOp operand) { |
| 1059 | ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |
| 1060 | HloInstructionProto instr; |
| 1061 | *instr.mutable_shape() = ShapeUtil::MakeNil().ToProto(); |
| 1062 | *instr.mutable_literal() = LiteralUtil::CreateR1U8(tag).ToProto(); |
| 1063 | return AddInstruction(std::move(instr), HloOpcode::kTrace, {operand}); |
| 1064 | }); |
| 1065 | } |
| 1066 | |
| 1067 | XlaOp XlaBuilder::Select(XlaOp pred, XlaOp on_true, XlaOp on_false) { |
| 1068 | return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |