(array, window_shape, axis=None, **kwargs)
| 133 | |
| 134 | |
| 135 | def sliding_window_view(array, window_shape, axis=None, **kwargs): |
| 136 | # TODO: some libraries (e.g. jax) don't have this, implement an alternative? |
| 137 | xp = get_array_namespace(array) |
| 138 | # sliding_window_view will not dispatch arbitrary kwargs (automatic_rechunk), |
| 139 | # so we need to hand-code this. |
| 140 | func = _dask_or_eager_func( |
| 141 | "sliding_window_view", |
| 142 | eager_module=xp.lib.stride_tricks, |
| 143 | dask_module=dask_array_compat, |
| 144 | dask_only_kwargs=("automatic_rechunk",), |
| 145 | numpy_only_kwargs=("subok", "writeable"), |
| 146 | ) |
| 147 | return func(array, window_shape, axis=axis, **kwargs) |
| 148 | |
| 149 | |
| 150 | def round(array): |
nothing calls this directly
no test coverage detected
searching dependent graphs…