Build fix for missing precision_config.

THe conversion from dot_general to dot fails when trying to retrieve
and use the precision config, since precision_config is optional.

PiperOrigin-RevId: 362095296
This commit is contained in:
Mahesh Ravishankar 2021-03-10 11:09:41 -08:00 committed by TensorFlow MLIR Team
parent e199df1dbf
commit b212bd66ae
1 changed files with 3 additions and 1 deletions

View File

@ -167,8 +167,10 @@ struct GeneralDotConvert : public OpRewritePattern<mlir::mhlo::DotGeneralOp> {
auto new_dot_type =
RankedTensorType::get({lhs_shape[0], rhs_shape[1]}, dot_element_type);
mlir::ArrayAttr precision_config;
if (op.precision_config()) precision_config = *op.precision_config();
auto new_dot_op = rewriter.create<mlir::mhlo::DotOp>(
op.getLoc(), new_dot_type, lhs, rhs, *(op.precision_config()));
op.getLoc(), new_dot_type, lhs, rhs, precision_config);
rewriter.replaceOpWithNewOp<mlir::mhlo::ReshapeOp>(op, op.getType(),
new_dot_op);