Skip to content
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

Make numpy optional dependency for torch.cuda.amp #48154

Closed
wants to merge 1 commit into from

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Nov 18, 2020

Test Plan: Uninstall numpy and try to importing torch

Discovered while working on #48145

Test Plan: Uninstall numpy and try to import torch
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.

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dr-ci
Copy link

dr-ci bot commented Nov 18, 2020

💊 CI failures summary and remediations

As of commit ec213a2 (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 1 ongoing upstream failure:

These were probably caused by upstream breakages that are not fixed yet:


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 1 time.

Comment on lines 148 to 151
elif isinstance(value, string_classes):
return value
elif isinstance(value, np.ndarray):
elif np is not None and isinstance(value, np.ndarray):
return value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: was wondering if we can just remove these 2 and add comments on the last default return (since it is a passthrough)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wouldn't work, since numpy arrays are iterable (i.e. isinstance(np.ndarray(5), container_abcs.Iterable) returns True )

@facebook-github-bot
Copy link
Contributor

@malfet merged this pull request in 1454cbf.

@malfet malfet deleted the malfet/make-numpy-optional-for-cuda-amp branch November 18, 2020 17:59
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.

None yet

3 participants