-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Open
Labels
Description
Describe the issue:
Since NumPy 1.23, the strides of empty (0 size) arrays are set to zero as changed in #21477. However, once such arrays are reshaped, the results have non-zero strides computed in a C-contiguous manner.
>>> import numpy as np
>>> a = np.ones((2, 0, 3))
>>> a.strides
(0, 0, 0)
>>> b = a.reshape((3, 0, 2))
>>> b.strides
(16, 16, 8) # also should be (0, 0, 0)NumPy/Python version information:
1.23.0 3.10.0 (default, Oct 15 2021, 11:40:42) [GCC 7.5.0]
Reactions are currently unavailable