forked from mindspore-Ecosystem/mindspore
!8178 Equal constant infer value
Merge pull request !8178 from huanghui/tensor-in-list
This commit is contained in:
commit
fd16535017
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue