Skip to content

Conversation

@vishwakftw
Copy link
Contributor

Fixes #4985 .

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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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.

@vishwakftw
Copy link
Contributor Author

Is this good to go? Sorry about the reminder.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@ezyang
Copy link
Contributor

ezyang commented Jul 17, 2018

No worries, reminders appreciated

@vishwakftw
Copy link
Contributor Author

Is this good to go?

@ailzhang ailzhang assigned ailzhang and unassigned ailzhang Jul 24, 2018
@ailzhang
Copy link
Contributor

cc: @li-roy @soumith

@vishwakftw vishwakftw deleted the numpy-scalar-torch branch July 30, 2018 21:42
jramseyer pushed a commit to jramseyer/pytorch that referenced this pull request Jul 31, 2018
Summary:
Fixes pytorch#4985 .
Pull Request resolved: pytorch#9225

Differential Revision: D8769317

Pulled By: ezyang

fbshipit-source-id: eeaeaf0749c9dc9e372634da68b4bd23e6e3ad28
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
Fixes pytorch#4985 .
Pull Request resolved: pytorch#9225

Differential Revision: D8769317

Pulled By: ezyang

fbshipit-source-id: eeaeaf0749c9dc9e372634da68b4bd23e6e3ad28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

np.intN types give TypeErrors

6 participants