!8178 Equal constant infer value

Merge pull request !8178 from huanghui/tensor-in-list
This commit is contained in:
mindspore-ci-bot 2020-11-04 11:29:39 +08:00 committed by Gitee
commit fd16535017
1 changed files with 5 additions and 0 deletions

View File

@ -2422,6 +2422,11 @@ class Equal(_LogicBinaryOp):
def infer_dtype(self, x_dtype, y_dtype):
return _LogicBinaryOp.do_infer_dtype(x_dtype, y_dtype, mstype.number_type + (mstype.bool_,), self.name)
def infer_value(self, x, y):
if x is not None and y is not None:
return Tensor(x.asnumpy() == y.asnumpy())
return None
class ApproximateEqual(_LogicBinaryOp):
"""