Skip to content

Add migration tables for NumPy as PyTorch#1004

Open
mtsokol wants to merge 2 commits intodata-apis:mainfrom
mtsokol:ms/migration-tables
Open

Add migration tables for NumPy as PyTorch#1004
mtsokol wants to merge 2 commits intodata-apis:mainfrom
mtsokol:ms/migration-tables

Conversation

@mtsokol
Copy link
Copy Markdown
Contributor

@mtsokol mtsokol commented Apr 16, 2026

No description provided.

Copy link
Copy Markdown
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mtsokol! Overall this looks great and will be quite useful. A couple of comments on adding some clarifying text.

how to use it.

### NumPy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be good to start here that the Array API column uses xp. but all those calls works with np. as well - and usually it's more idiomatic NumPy anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, I added a clarification.

| `x.flatten` | `xp.reshape(x, (-1,))` | |

### PyTorch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a similar but slightly different note: most of the second column is available in PyTorch, but there are a few entries that rely on array-api-compat usage (which is the recommended way to add PyTorch support to a library that wants to use the array API).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, for PyTorch we need array-api-compat in way more cases so I think it's better to require compat anyway for clarity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rgommers rgommers added the Narrative Content Narrative documentation content. label Apr 16, 2026
@tylerjereddy
Copy link
Copy Markdown

ah yeah, really useful, just read through it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Narrative Content Narrative documentation content.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants