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 bug on torch 1.9.0 #22

Open
wants to merge 1 commit into
base: main
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
5 changes: 3 additions & 2 deletions actnn/actnn/_utils/collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import torch
import re
from torch._six import container_abcs, string_classes, int_classes
from torch._six import string_classes
import collections.abc as container_abcs

np_str_obj_array_pattern = re.compile(r'[SaUO]')

Expand Down Expand Up @@ -66,7 +67,7 @@ def default_collate(batch):
return torch.as_tensor(batch)
elif isinstance(elem, float):
return torch.tensor(batch, dtype=torch.float64)
elif isinstance(elem, int_classes):
elif isinstance(elem, int):
return torch.tensor(batch)
elif isinstance(elem, string_classes):
return batch
Expand Down
4 changes: 3 additions & 1 deletion actnn/actnn/_utils/pin_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"""

import torch
from torch._six import queue, container_abcs, string_classes
from torch._six import string_classes
import queue
import collections.abc as container_abcs
from . import MP_STATUS_CHECK_INTERVAL
from torch._utils import ExceptionWrapper

Expand Down
2 changes: 1 addition & 1 deletion actnn/actnn/_utils/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import random
import os
from collections import namedtuple
from torch._six import queue
import queue
from torch._utils import ExceptionWrapper
from . import signal_handling, MP_STATUS_CHECK_INTERVAL, IS_WINDOWS

Expand Down
3 changes: 2 additions & 1 deletion actnn/actnn/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import torch
import torch.multiprocessing as multiprocessing
from torch._utils import ExceptionWrapper
from torch._six import queue, string_classes
import queue
from torch._six import string_classes

from torch.utils.data import IterableDataset, Sampler, SequentialSampler, RandomSampler, BatchSampler
from . import _utils
Expand Down