Tensor.__eq__¶
-
Tensor.
__eq__
(self, other)¶ Return
self == other
.Two elements are equal if their distance is zero.
- Parameters
- other
LinearSpaceElement
Element of this space.
- other
- Returns
- equalsbool
True
if the elements are equalFalse
otherwise.
See also
LinearSpace.dist
Notes
Equality is very sensitive to numerical errors, thus any arithmetic operations should be expected to break equality.
Examples
>>> rn = odl.rn(1, norm=np.linalg.norm) >>> x = rn.element([0.1]) >>> x == x True >>> y = rn.element([0.1]) >>> x == y True >>> z = rn.element([0.3]) >>> x + x + x == z False