| 2390 | } |
| 2391 | |
| 2392 | void XlaBuilder::Send(XlaOp operand, const ChannelHandle& handle) { |
| 2393 | ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |
| 2394 | // Send HLO takes two operands: a data operand and a token. Generate the |
| 2395 | // token to pass into the send. |
| 2396 | // TODO(b/80000000): Remove this when clients have been updated to handle |
| 2397 | // tokens. |
| 2398 | HloInstructionProto token_instr; |
| 2399 | *token_instr.mutable_shape() = ShapeUtil::MakeTokenShape().ToProto(); |
| 2400 | TF_ASSIGN_OR_RETURN(XlaOp token, AddInstruction(std::move(token_instr), |
| 2401 | HloOpcode::kAfterAll, {})); |
| 2402 | |
| 2403 | return SendWithToken(operand, token, handle); |
| 2404 | }); |
| 2405 | } |
| 2406 | |
| 2407 | XlaOp XlaBuilder::SendWithToken(XlaOp operand, XlaOp token, |
| 2408 | const ChannelHandle& handle) { |
no test coverage detected