-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: Array API reshape
does not conform to standard
#23410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@asmeurer :) I can't make a PR just yet, but here's the issue :) |
Yes, anything in the 2021.12 standard should be implemented in np.array_api. This was just missed. |
I had a quick go at cleaning this up, but I am a little unclear what the semantics of "copy" means here. Does it just refer to the underlying array data, or does it refer to the array object? Like if I have an initial commit here. It looks like there were a few missing unit tests for the array manipulation functions, so I added them. I only tested for things that were different between Numpy and the Array API, as it looks like that is what is being done elsewhere. Is that alright. Also, it looks like copying isn't fully implemented for |
@bwalshe conventionally |
That's maybe something that could be clarified in the standard, but In numpy.array_api in particular, there's two objects, the wrapper
The test suite in numpy.array_api only focuses on things that aren't already tested by array-api-tests. This primarily means strictness things (i.e., mostly exceptions), because the spec doesn't require strictness so the array-api test suite doesn't check for it, but we do want numpy.array_api to be strict/minimal. Your tests look fine to me. The actual reshape tests themselves aren't strictly needed if you consider array-api-tests, but all the Can you open a PR with your fix? |
Thhis adds a parameter to api.reshape to specify if data should be copied. This parameter is required so that api.reshape conforms to the standard. See numpy#23410
This adds a parameter to api.reshape to specify if data should be copied. This parameter is required so that api.reshape conforms to the standard. See numpy#23410
@asmeurer I feel this fix is still a wip, and may need some changes to the C code to get working the way I would like. I have not had a chance to look into this in a while, but I have opened a PR with the changes I have made so far. I might need a bit of guidance to get this closed. |
This adds a parameter to api.reshape to specify if data should be copied. This parameter is required so that api.reshape conforms to the standard. See numpy#23410
Describe the issue:
The
reshape
manipulation function in the new Array API takes acopy
argument that we don't replicate in NumPy.I think this is unintentional
Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: