Skip to content

[Docs] Potential typo in cross-referencing Tensor.from_numpy #4310

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

Open
MehdiChelh opened this issue Apr 8, 2025 · 0 comments
Open

[Docs] Potential typo in cross-referencing Tensor.from_numpy #4310

MehdiChelh opened this issue Apr 8, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation max-repo

Comments

@MehdiChelh
Copy link

Where is the problem?

https://docs.modular.com/max/tutorials/build-custom-ops

What can we do better?

The current documentation states that converting Numpy Arrays to Mojo Tensors can be done using the Max Driver API. However, this creates confusion as the documentation references the Mojo API for this functionality, while the feature appears to be only available through the Python API.

The API's Tensor class is designed for seamless integration with common Python frameworks - it offers zero-copy interoperability with both NumPy arrays and PyTorch tensors. Here's how we can leverage this to create a MAX Tensor from random data...

Specifically, users searching for Tensor.from_numpy in the Mojo API will not find this method, as it exists only in the Python implementation. I encountered this issue myself when attempting to use this conversion feature.

Suggested Improvement: Update the documentation to provide appropriate cross-references to guide users to the correct API documentation.

The API's Tensor class is designed for seamless integration with common Python frameworks - it offers zero-copy interoperability with both NumPy arrays and PyTorch tensors. Here's how we can leverage this to create a MAX Tensor from random data...

Anything else?

No response

@MehdiChelh MehdiChelh added documentation Improvements or additions to documentation max-repo labels Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation max-repo
Projects
None yet
Development

No branches or pull requests

1 participant