Skip to content

Commit b283c24

Browse files
committed
Update T2T_ViT
1 parent bd46b55 commit b283c24

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

timm/models/t2t_vit.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
3939
from timm.layers import Mlp, LayerNorm, DropPath, trunc_normal_, to_2tuple
4040

41-
from timm.models._builder import build_model_with_cfg
42-
from timm.models._features import feature_take_indices
43-
from timm.models._manipulate import checkpoint
44-
from timm.models._registry import generate_default_cfgs, register_model
41+
from ._builder import build_model_with_cfg
42+
from ._features import feature_take_indices
43+
from ._manipulate import checkpoint
44+
from ._registry import generate_default_cfgs, register_model
4545

4646
def get_sinusoid_encoding(n_position: int, d_hid: int) -> torch.Tensor:
4747
''' Sinusoid position encoding table using PyTorch '''
@@ -267,7 +267,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
267267

268268
# final tokens
269269
x = self.project(x)
270-
271270
return x
272271

273272
class Attention(nn.Module):
@@ -597,40 +596,40 @@ def checkpoint_filter_fn(
597596

598597
default_cfgs = generate_default_cfgs({
599598
't2t_vit_7.in1k': _cfg(
600-
hf_hub_id='timm/',
601-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/71.7_T2T_ViT_7.pth.tar',
599+
# hf_hub_id='timm/',
600+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/71.7_T2T_ViT_7.pth.tar',
602601
),
603602
't2t_vit_10.in1k': _cfg(
604-
hf_hub_id='timm/',
605-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/75.2_T2T_ViT_10.pth.tar'
603+
# hf_hub_id='timm/',
604+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/75.2_T2T_ViT_10.pth.tar'
606605
),
607606
't2t_vit_12.in1k': _cfg(
608-
hf_hub_id='timm/',
609-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/76.5_T2T_ViT_12.pth.tar'
607+
# hf_hub_id='timm/',
608+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/76.5_T2T_ViT_12.pth.tar'
610609
),
611610
't2t_vit_14.in1k': _cfg(
612-
hf_hub_id='timm/',
613-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.5_T2T_ViT_14.pth.tar'
611+
# hf_hub_id='timm/',
612+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.5_T2T_ViT_14.pth.tar'
614613
),
615614
't2t_vit_19.in1k': _cfg(
616-
f_hub_id='timm/',
617-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.9_T2T_ViT_19.pth.tar'
615+
# f_hub_id='timm/',
616+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.9_T2T_ViT_19.pth.tar'
618617
),
619618
't2t_vit_24.in1k': _cfg(
620-
hf_hub_id='timm/',
621-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.3_T2T_ViT_24.pth.tar'
619+
# hf_hub_id='timm/',
620+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.3_T2T_ViT_24.pth.tar'
622621
),
623622
't2t_vit_t_14.in1k': _cfg(
624-
hf_hub_id='timm/',
625-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.7_T2T_ViTt_14.pth.tar'
623+
# hf_hub_id='timm/',
624+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.7_T2T_ViTt_14.pth.tar'
626625
),
627626
't2t_vit_t_19.in1k': _cfg(
628-
hf_hub_id='timm/',
629-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.4_T2T_ViTt_19.pth.tar'
627+
# hf_hub_id='timm/',
628+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.4_T2T_ViTt_19.pth.tar'
630629
),
631630
't2t_vit_t_24.in1k': _cfg(
632-
hf_hub_id='timm/',
633-
# url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.6_T2T_ViTt_24.pth.tar'
631+
# hf_hub_id='timm/',
632+
url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.6_T2T_ViTt_24.pth.tar'
634633
),
635634
})
636635

0 commit comments

Comments
 (0)