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 torch version check numeric #4285

Merged
merged 2 commits into from
Aug 17, 2021

Conversation

jithunnair-amd
Copy link
Contributor

String comparison messes up in cases such as torch.__version__ = 1.10.blah

@jithunnair-amd jithunnair-amd force-pushed the numeric_torch_version_check branch from 411b1f8 to 106b293 Compare August 17, 2021 16:30
Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Will merge once the CI completes.

@datumbox datumbox merged commit f3aff2f into pytorch:master Aug 17, 2021
facebook-github-bot pushed a commit that referenced this pull request Aug 20, 2021
Summary: Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>

Reviewed By: NicolasHug

Differential Revision: D30417204

fbshipit-source-id: 17ba279a691378c2f6ad9968bd7b9ece823173a6
Comment on lines -150 to +152
if torch.__version__ >= '1.5':
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR > 1 or (TORCH_MAJOR == 1 and TORCH_MINOR >= 5):
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Created an issue to track this down #4296

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to use the new torch.__version__ as a TorchVersion object , then just reverting this pr will do the job.
Or can I create a new pr for just one line?

Copy link
Member

Choose a reason for hiding this comment

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

Or can I create a new pr for just one line?

Yup :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.
Thanks Sir

jithunnair-amd added a commit to ROCm/vision that referenced this pull request Aug 23, 2021
Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
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.

6 participants