Browse Source

!4698 Add shape inference in constant multiplication simplification

Merge pull request !4698 from Giancarlo/setshape_constmult
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
d2ea6d8cfc
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      mindspore/ccsrc/frontend/optimizer/irpass/arithmetic_simplify.cc

+ 3
- 1
mindspore/ccsrc/frontend/optimizer/irpass/arithmetic_simplify.cc View File

@@ -53,7 +53,9 @@ AnfNodePtr ArithmeticSimplify::operator()(const OptimizerPtr &, const AnfNodePtr
auto ttmul = NewCNode({mul_node, const_.GetNode(node), const_2.GetNode(node)}, node->func_graph());
return NewCNode({mul_node, x.GetNode(node), ttmul}, node->func_graph());
}
return NewCNode({mul_node, x.GetNode(node), new_mul_tensor}, node->func_graph());
auto new_cnode = NewCNode({mul_node, x.GetNode(node), new_mul_tensor}, node->func_graph());
new_cnode->set_abstract(node->abstract());
return new_cnode;
};
MATCH_REPLACE_LAMBDA(node, const_ * (const_2 * x), const_dup_lambda);



Loading…
Cancel
Save