Skip to content

Commit

Permalink
Merge pull request huggingface#421 from aboutmedicine/master
Browse files Browse the repository at this point in the history
Update collections.abc import to avoid pytorch 1.8 issue. Fix huggingface#420
  • Loading branch information
rwightman authored Feb 10, 2021
2 parents c0cf7f6 + 5cdb7af commit 323e7fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions timm/models/layers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 323e7fb

Please sign in to comment.