Skip to content

docs: fix PyTorch to MLX conversion example - #3265

Merged
angeloskath merged 2 commits into
ml-explore:mainfrom
LxYuan0420:fix/docs-pytorch-conversion
Mar 16, 2026
Merged

angeloskath merged 2 commits into
ml-explore:mainfrom
LxYuan0420:fix/docs-pytorch-conversion

Conversation

@LxYuan0420

@LxYuan0420 LxYuan0420 commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

mx.array() accepts PyTorch tensors directly (including bfloat16) via DLPack since #1305 (Aug 2024). The docs still showed mx.array(b.numpy()) and stated conversion "must be done via intermediate NumPy arrays", which is no longer true.

Tested locally on MLX 0.30.6, PyTorch 2.9.1, macOS 15.7.

Screenshots:
Screenshot 2026-03-16 at 2 14 27 PM
Screenshot 2026-03-16 at 2 19 28 PM

@angeloskath angeloskath left a comment

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.

Thanks!

@LxYuan0420
LxYuan0420 force-pushed the fix/docs-pytorch-conversion branch from d2e0cf7 to d7945e7 Compare March 16, 2026 06:23
@LxYuan0420
LxYuan0420 force-pushed the fix/docs-pytorch-conversion branch from d7945e7 to 181cc34 Compare March 16, 2026 06:27
@angeloskath
angeloskath merged commit 1d44d91 into ml-explore:main Mar 16, 2026
@BrewTestBot BrewTestBot mentioned this pull request Apr 22, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants