Fix zero attr mistake

PiperOrigin-RevId: 331050555
This commit is contained in:
Robert Suderman 2020-09-10 17:20:48 -07:00 committed by TensorFlow MLIR Team
parent b22f2f0eea
commit 6eefb07767
1 changed files with 2 additions and 1 deletions

View File

@ -1362,7 +1362,8 @@ OpFoldResult OrOp::fold(ArrayRef<Attribute> operands) {
OpFoldResult XorOp::fold(ArrayRef<Attribute> operands) {
auto rType = getType().cast<ShapedType>();
if (lhs() == rhs()) {
return DenseIntElementsAttr::get(rType, 0);
Builder builder(getContext());
return builder.getZeroAttr(rType);
}
auto lhsVal = operands[0].dyn_cast_or_null<DenseElementsAttr>();