-
Notifications
You must be signed in to change notification settings - Fork 24.3k
__array__ and __array_wrap__ #2935
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
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
Yes that looks great! Note that it's much simpler to use |
Alright, I'll make a PR then.
You're right, I don't know why I overlooked this. Regarding placement, my suggestion is to define the generic methods like above in |
|
Uh oh!
There was an error while loading. Please reload this page.
To improve Numpy interoperability, torch tensors could implement the array interface in a quite simple manner:
It would enable simple things like
numpy.asarray
to turn tensors into Numpy arrays, and with that make basically all of Numpy applicable to torch tensors (with some restrictions). Is something like that of interest?The text was updated successfully, but these errors were encountered: