-
Notifications
You must be signed in to change notification settings - Fork 26.3k
NumPy Scalar to PyTorch Scalar #9225
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
Conversation
torch/csrc/utils/tensor_new.cpp
Outdated
| if (PyArray_Check(obj)) { | ||
| auto array = (PyArrayObject*)obj; | ||
| return numpy_dtype_to_aten(PyArray_TYPE(array)); | ||
| } else if (PyArray_CheckScalar(obj)) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
torch/csrc/utils/tensor_new.cpp
Outdated
| return numpy_dtype_to_aten(PyArray_TYPE(array)); | ||
| } | ||
| if (PyArray_CheckScalar(obj)) { | ||
| auto array = (PyArrayObject*)(PyArray_FromScalar(obj, NULL)); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Is this good to go? Sorry about the reminder. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
No worries, reminders appreciated |
|
Is this good to go? |
Summary: Fixes pytorch#4985 . Pull Request resolved: pytorch#9225 Differential Revision: D8769317 Pulled By: ezyang fbshipit-source-id: eeaeaf0749c9dc9e372634da68b4bd23e6e3ad28
Summary: Fixes pytorch#4985 . Pull Request resolved: pytorch#9225 Differential Revision: D8769317 Pulled By: ezyang fbshipit-source-id: eeaeaf0749c9dc9e372634da68b4bd23e6e3ad28
Fixes #4985 .