From 6c7b57614b8b81dcfd6939db0bcbb28a4e823e10 Mon Sep 17 00:00:00 2001 From: Youqing Xiaozhua <843213558@qq.com> Date: Fri, 31 Mar 2023 17:02:47 +0000 Subject: [PATCH] upgrade to support pytorch2.0 --- mmcls/models/vit/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmcls/models/vit/layers.py b/mmcls/models/vit/layers.py index e3b699e..e03364f 100755 --- a/mmcls/models/vit/layers.py +++ b/mmcls/models/vit/layers.py @@ -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