Function
_nd_cum_func
(cum_func, array, axis, **kwargs)
Source from the content-addressed store, hash-verified
| 791 | |
| 792 | |
| 793 | def _nd_cum_func(cum_func, array, axis, **kwargs): |
| 794 | array = asarray(array) |
| 795 | if axis is None: |
| 796 | axis = tuple(range(array.ndim)) |
| 797 | if isinstance(axis, int): |
| 798 | axis = (axis,) |
| 799 | |
| 800 | out = array |
| 801 | for ax in axis: |
| 802 | out = cum_func(out, axis=ax, **kwargs) |
| 803 | return out |
| 804 | |
| 805 | |
| 806 | def ndim(array) -> int: |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…