| 676 | } |
| 677 | |
| 678 | XlaOp XlaBuilder::Iota(const Shape& shape, int64 iota_dimension) { |
| 679 | return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |
| 680 | HloInstructionProto instr; |
| 681 | *instr.mutable_shape() = shape.ToProto(); |
| 682 | instr.add_dimensions(iota_dimension); |
| 683 | return AddInstruction(std::move(instr), HloOpcode::kIota); |
| 684 | }); |
| 685 | } |
| 686 | |
| 687 | XlaOp XlaBuilder::Iota(PrimitiveType type, int64 size) { |
| 688 | return Iota(ShapeUtil::MakeShape(type, {size}), /*iota_dimension=*/0); |
no test coverage detected