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

Fixed container_abcs removed from torch._six #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joel-huang
Copy link

As per NVIDIA/apex#1049

Nightly PyTorch has removed container_abcs from torch._six.
pytorch/pytorch@58eb233#diff-b3c160475f0fbe8ad50310f92d3534172ba98203387a962b7dc8f4a23b15cf4dL35

Change

from torch._six import container_abcs

to:

TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])

if TORCH_MAJOR == 1 and TORCH_MINOR < 8:
    from torch._six import container_abcs
else:
    import collections.abc as container_abcs

@cclauss
Copy link

cclauss commented Aug 14, 2021

import collections.abc as container_abcs will work for Python 3.3+ so why bother with the other lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants