Esempio n. 1
0
 def __eq__(self, other):
     if not isinstance(other, Tensor):
         if isinstance(other, _expr.ExprOp):
             return _expr.EqualOp(self, other)
         return False
     if self.ndim == 0 and other.ndim == 0:
         raise ValueError("Equal == comparison among rank-0 tensor is ambiguous, "
                          "use Tensor.equal for content expression equvalence, "
                          "use Tensor.same_as for exact reference comparison")
     return _api_internal._TensorEqual(self, other)
Esempio n. 2
0
 def __eq__(self, other):
     if not isinstance(other, Tensor):
         if isinstance(other, _expr.ExprOp):
             return _expr.EqualOp(self, other)
         return False
     if self.same_as(other):
         return True
     if self.ndim == 0 and other.ndim == 0:
         raise ValueError(
             "Equal == comparison among rank-0 tensor is ambiguous, "
             "use Tensor.equal for content expression equvalence.")
     return _ffi_api.TensorEqual(self, other)
Esempio n. 3
0
 def __eq__(self, other):
     if not isinstance(other, Tensor):
         if isinstance(other, _expr.ExprOp):
             return _expr.EqualOp(self, other)
         return False
     return _ffi_api.TensorEqual(self, other)