I'm aware that ascontiguousarray returns a contiguous array in memory, but can someone tell me when will it be really necessary? i.e. result is wrong without this function? or perhaps this will make following operations more efficient?
I wrote a convolution function, where I used as_strided to change its shape and strides, then einsum to multiply with kernel, finally a moveaxis so the final shape is (N,C,H,W) as in pytorch. So in this case, do you think I should use an ascontiguousarray before the output? Thanks!