(self, ufunc, method, *inputs, **kwargs)
| 74 | __setitem__ = wrap("__setitem__") |
| 75 | |
| 76 | def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): |
| 77 | if not all( |
| 78 | isinstance(i, (type(self), np.ndarray) + np.ScalarType) for i in inputs |
| 79 | ): |
| 80 | return NotImplemented |
| 81 | inputs = tuple(i if not isinstance(i, type(self)) else i.arr for i in inputs) |
| 82 | a = getattr(ufunc, method)(*inputs, **kwargs) |
| 83 | return a if not isinstance(a, np.ndarray) else type(self)(a) |
| 84 | |
| 85 | shape = dispatch_property("shape") |
| 86 | ndim = dispatch_property("ndim") |