MCPcopy Create free account
hub / github.com/numpy/numpy / __array_ufunc__

Method __array_ufunc__

numpy/core/tests/test_ufunc.py:2331–2333  ·  view source on GitHub ↗
(self, ufunc, method, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

2329
2330 class MyA(np.ndarray):
2331 def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
2332 return getattr(ufunc, method)(*(input.view(np.ndarray)
2333 for input in inputs), **kwargs)
2334 a = np.arange(12.).reshape(4,3)
2335 ra = a.view(dtype=('f8,f8,f8')).squeeze()
2336 mra = ra.view(MyA)

Callers

nothing calls this directly

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected