(self, A, block=(3, 3))
| 94 | return ans |
| 95 | |
| 96 | def __rolling_block(self, A, block=(3, 3)): |
| 97 | shape = (A.shape[0] - block[0] + 1, A.shape[1] - block[1] + 1) + block |
| 98 | strides = (A.strides[0], A.strides[1]) + A.strides |
| 99 | return as_strided(A, shape=shape, strides=strides) |