Skip to content

Commit

Permalink
upgrade to support pytorch2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
youqingxiaozhua committed Mar 31, 2023
1 parent f3b392b commit 6c7b576
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmcls/models/vit/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):
###
# From PyTorch internals
from itertools import repeat
from torch._six import container_abcs
import collections.abc
def _ntuple(n) :
def parse(x) -> Tuple[int]:
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 6c7b576

Please sign in to comment.