Greetings,

I have another question about mxnet. I want to know how it would be possible to split an array into sub-windos.

I know that for numpy the code is :

n, c, h, w = img.shape

kernel_h,kernel_w=(3,3)

step_x,step_y=(1,1)

out_w=w-2

out_h=h-2

col = np.ndarray((n, c, out_h, out_w, kernel_h, kernel_w), dtype=img.dtype)

for R in range(kernel_h):

j_lim = R + step_y * out_h

for H in range(kernel_w):

i_lim = H + step_x * out_w

col[:,:,:,:,R,H]=img[:, :, R:j_lim:step_y, H:i_lim:step_x]

return col

But I don’t know if it can be done with the mxnet python API. With current functions the only option would be to have a nested loop that would stack slices for the second-to last axis and then stack those too with a loop .

I am unaware if there is a more optimal solution for this or if another approach would be possible.

Thanks again!