-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.topic: ManipulationArray manipulation and transformation.Array manipulation and transformation.
Description
Should we have a ravel() or flatten() function? Right now you can do it with reshape, but it's maybe not obvious. reshape also has the advantage in that it can be explicit about copying.
If not, I wonder if we should have some page or documentation somewhere to indicate the best workarounds for NumPy functions that aren't included in the standard, like "replace ravel(x) with reshape(x, (x.size,))".
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.topic: ManipulationArray manipulation and transformation.Array manipulation and transformation.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
rgommers commentedon Jul 16, 2023
I'd prefer that - keeping the standard to one way of doing things. Such a page would be useful for many users. We may also add guidance for PyTorch/JAX/etc. users there as needed.
The question is where it should live. Maybe under the
Otherheading in the top-level structure (see https://data-apis.org/array-api/latest/index.html)?asmeurer commentedon Jul 16, 2023
Correction. Should be "replace
ravel(x)withreshape(x, (-1,))".[-]ravel()/flatten()[/-][+]RFC: add `ravel()` (or `flatten()`)[/+]