!4644 Update value comparing with 0 in Greater

Merge pull request !4644 from thlinh/dev_Aug17_update_greater_check
This commit is contained in:
mindspore-ci-bot 2020-08-18 16:10:45 +08:00 committed by Gitee
commit a812bf2ef3
1 changed files with 2 additions and 2 deletions

View File

@ -98,10 +98,10 @@ AnfNodePtr ValueBasedEliminate::operator()(const OptimizerPtr &, const AnfNodePt
PConstant zero_scalar_(node, false, 0, true); PConstant zero_scalar_(node, false, 0, true);
// {prim::kPrimSelect, {prim::kPrimGreater, X, 0}, Y, Z}} -> Y when X is always greater than 0 // {prim::kPrimSelect, {prim::kPrimGreater, X, 0}, Y, Z}} -> Y when X is always greater than 0
MATCH_REPLACE_IF(node, PPrimitive(prim::kPrimSelect, PPrimitive(prim::kPrimGreater, x, zero_), y, z), y, MATCH_REPLACE_IF(node, PPrimitive(prim::kPrimSelect, PPrimitive(prim::kPrimGreaterEqual, x, zero_), y, z), y,
IsCNodePositive(x.GetNode(node))); IsCNodePositive(x.GetNode(node)));
MATCH_REPLACE_IF(node, PPrimitive(prim::kPrimSelect, PPrimitive(prim::kPrimGreater, x, zero_scalar_), y, z), y, MATCH_REPLACE_IF(node, PPrimitive(prim::kPrimSelect, PPrimitive(prim::kPrimGreaterEqual, x, zero_scalar_), y, z), y,
IsCNodePositive(x.GetNode(node))); IsCNodePositive(x.GetNode(node)));
// {prim::kPrimMaximum, X, LOWER_FLT_LIMIT}} -> X // {prim::kPrimMaximum, X, LOWER_FLT_LIMIT}} -> X