Skip to content

Commit

Permalink
Update tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/hlo_ops.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-eph committed Dec 27, 2021
1 parent a1ad36d commit 3f60589
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -4436,6 +4436,7 @@ OpFoldResult MulOp::fold(ArrayRef<Attribute> attrs) {
if (attrs[0] && attrs[1]) {
BINARY_FOLDER_INTERNAL(MulOp, std::multiplies);
}
// Handle special case where one operand is 1: x * 1 => x
if (attrs[0] || attrs[1]) {
SplatElementsAttr attr = attrs[0] ? attrs[0].dyn_cast<SplatElementsAttr>()
: attrs[1].dyn_cast<SplatElementsAttr>();
Expand Down

0 comments on commit 3f60589

Please sign in to comment.