NumpyTensorSpace.__eq__

NumpyTensorSpace.__eq__(self, other)[source]

Return self == other.

Returns
equalsbool

True if other is an instance of type(self) with the same NumpyTensorSpace.shape, NumpyTensorSpace.dtype and NumpyTensorSpace.weighting, otherwise False.

Examples

>>> space = odl.rn(3)
>>> same_space = odl.rn(3, exponent=2)
>>> same_space == space
True

Different shape, exponent or dtype all result in different spaces:

>>> diff_space = odl.rn((3, 4))
>>> diff_space == space
False
>>> diff_space = odl.rn(3, exponent=1)
>>> diff_space == space
False
>>> diff_space = odl.rn(3, dtype='float32')
>>> diff_space == space
False
>>> space == object
False