I see. I would have expected the memoryview to not know anything about shapes.
Do you know if that reshape copies the data? It returns a new array, so I guess it must, isn’t it?
In that case I could slice A.tobytes(). The actual array is large. I would like to not have to make a copy.
…
I just found that there is a memoryview.cast that can modify the shape. So, I could do
import math
A.data.cast('B', shape=(math.prod(A.shape)*4,))[0:1]
Let me check if that cast only affects the memoryview’s information about shape and data type and does not have to make a copy.