Open minghuaw opened 4 weeks ago
I will take a look -- I suspect the readout (asArray) is expecting contiguous memory but not getting it. asData may have the same issue.
I will take a look -- I suspect the readout (asArray) is expecting contiguous memory but not getting it. asData may have the same issue.
tolist()
in python checks the stride: https://github.com/ml-explore/mlx/blob/21623156a32910b9db7c913f91612dcde0282caf/python/src/array.cpp#L34
This may just be my confusion but as shown in the example below, I was expecting that calling
asArray
on theMLXArray
returned from indexing would give[1, 2, 4, 5]
but ended up getting[1,2,3,4]
. This seems to be inconsistent with the python api where callingtolist()
would give[[1, 2], [4, 5]]
.The documentation doesn't seem to mention this behavior either