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

Fix import for depreciated torch._six #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bindsnet/datasets/collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"""

import torch
from torch._six import container_abcs, string_classes, int_classes

# https://github.com/pytorch/pytorch/pull/94709#issuecomment-1461471006
try:
from torch._six import container_abcs, string_classes, int_classes
except ImportError:
int_classes = int
string_classes = str
import collections.abc as container_abcs

from torch.utils.data._utils import collate as pytorch_collate

Expand Down
8 changes: 7 additions & 1 deletion bindsnet/pipeline/base_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
from typing import Tuple, Dict, Any

import torch
from torch._six import container_abcs, string_classes

# https://github.com/pytorch/pytorch/pull/94709#issuecomment-1461471006
try:
from torch._six import container_abcs, string_classes
except ImportError:
string_classes = str
import collections.abc as container_abcs

from ..network import Network
from ..network.monitors import Monitor
Expand Down