MCPcopy Index your code
hub / github.com/dask/dask / __array_function__

Method __array_function__

dask/array/tests/test_dispatch.py:59–70  ·  view source on GitHub ↗
(self, f, t, arrs, kw)

Source from the content-addressed store, hash-verified

57 return np.asarray(self.arr, *args, **kwargs)
58
59 def __array_function__(self, f, t, arrs, kw):
60 if not all(
61 issubclass(ti, (type(self), np.ndarray) + np.ScalarType) for ti in t
62 ):
63 return NotImplemented
64 arrs = tuple(
65 arr if not isinstance(arr, type(self)) else arr.arr for arr in arrs
66 )
67 t = tuple(ti for ti in t if not issubclass(ti, type(self)))
68 print(t)
69 a = self.arr.__array_function__(f, t, arrs, kw)
70 return a if not isinstance(a, np.ndarray) else type(self)(a)
71
72 __getitem__ = wrap("__getitem__")
73

Callers

nothing calls this directly

Calls 2

allFunction · 0.85
__array_function__Method · 0.45

Tested by

no test coverage detected