| 1128 | } |
| 1129 | |
| 1130 | XlaOp XlaBuilder::DotGeneral(XlaOp lhs, XlaOp rhs, |
| 1131 | const DotDimensionNumbers& dimension_numbers, |
| 1132 | const PrecisionConfig* precision_config) { |
| 1133 | return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |
| 1134 | HloInstructionProto instr; |
| 1135 | TF_ASSIGN_OR_RETURN(const Shape* lhs_shape, GetShapePtr(lhs)); |
| 1136 | TF_ASSIGN_OR_RETURN(const Shape* rhs_shape, GetShapePtr(rhs)); |
| 1137 | TF_ASSIGN_OR_RETURN(Shape shape, |
| 1138 | ShapeInference::InferDotOpShape(*lhs_shape, *rhs_shape, |
| 1139 | dimension_numbers)); |
| 1140 | *instr.mutable_shape() = shape.ToProto(); |
| 1141 | *instr.mutable_dot_dimension_numbers() = dimension_numbers; |
| 1142 | if (precision_config != nullptr) { |
| 1143 | *instr.mutable_precision_config() = *precision_config; |
| 1144 | } |
| 1145 | return AddInstruction(std::move(instr), HloOpcode::kDot, {lhs, rhs}); |
| 1146 | }); |
| 1147 | } |
| 1148 | |
| 1149 | Status XlaBuilder::VerifyConvolution( |
| 1150 | const Shape& lhs_shape, const Shape& rhs_shape, |
no test coverage detected