mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Merge pull request #421 from aboutmedicine/master
Update collections.abc import to avoid pytorch 1.8 issue. Fix #420
This commit is contained in:
commit
b9bd960a03
@ -3,13 +3,13 @@
|
||||
Hacked together by / Copyright 2020 Ross Wightman
|
||||
"""
|
||||
from itertools import repeat
|
||||
from torch._six import container_abcs
|
||||
import collections.abc
|
||||
|
||||
|
||||
# From PyTorch internals
|
||||
def _ntuple(n):
|
||||
def parse(x):
|
||||
if isinstance(x, container_abcs.Iterable):
|
||||
if isinstance(x, collections.abc.Iterable):
|
||||
return x
|
||||
return tuple(repeat(x, n))
|
||||
return parse
|
||||
|
Loading…
x
Reference in New Issue
Block a user