Browse Source

!8178 Equal constant infer value

Merge pull request !8178 from huanghui/tensor-in-list
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
fd16535017
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      mindspore/ops/operations/math_ops.py

+ 5
- 0
mindspore/ops/operations/math_ops.py 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):
"""


Loading…
Cancel
Save