Closed vtavana closed 1 week ago
These functions have order="C"
aas the default value. Even NumPy
with order="K"
in does not guarantee the output to have the same strides as input.
import numpy
a = numpy.ones((10,8))
b = a[::2,::2]
b.strides
# (128, 16)
c = numpy.empty_like(b)
c.strides
# (32, 8)
Array created using
dpt.empty_like
,dpt.zeros_like
anddpt.ones_like
does not have the same stride as the input array.