Skip to content

Commit cd1542a

Browse files
committed
remove unused import
1 parent 03fa149 commit cd1542a

File tree

11 files changed

+9
-19
lines changed

11 files changed

+9
-19
lines changed

timm/models/crossvit.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@
1414
NOTE: model names have been renamed from originals to represent actual input res all *_224 -> *_240 and *_384 -> *_408
1515
1616
Modifications and additions for timm hacked together by / Copyright 2021, Ross Wightman
17+
Modified from Timm. https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
1718
"""
1819

1920
# Copyright IBM All Rights Reserved.
2021
# SPDX-License-Identifier: Apache-2.0
2122

22-
23-
"""
24-
Modified from Timm. https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
25-
26-
"""
2723
from functools import partial
2824
from typing import List, Optional, Tuple
2925

3026
import torch
31-
import torch.hub
3227
import torch.nn as nn
3328

3429
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

timm/models/dla.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import torch
1212
import torch.nn as nn
13-
import torch.nn.functional as F
1413

1514
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
1615
from timm.layers import create_classifier

timm/models/efficientvit_mit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from ._builder import build_model_with_cfg
2020
from ._features import feature_take_indices
2121
from ._features_fx import register_notrace_module
22-
from ._manipulate import checkpoint, checkpoint_seq
22+
from ._manipulate import checkpoint_seq
2323
from ._registry import register_model, generate_default_cfgs
2424

2525

timm/models/ghostnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ._builder import build_model_with_cfg
2424
from ._efficientnet_blocks import SqueezeExcite, ConvBnAct
2525
from ._features import feature_take_indices
26-
from ._manipulate import checkpoint, checkpoint_seq
26+
from ._manipulate import checkpoint_seq
2727
from ._registry import register_model, generate_default_cfgs
2828

2929
__all__ = ['GhostNet']

timm/models/hrnet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import torch
1515
import torch.nn as nn
16-
import torch.nn.functional as F
1716

1817
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
1918
from timm.layers import create_classifier

timm/models/nfnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from collections import OrderedDict
2020
from dataclasses import dataclass, replace
2121
from functools import partial
22-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
22+
from typing import Any, Callable, Dict, Optional, Tuple
2323

2424
import torch
2525
import torch.nn as nn

timm/models/selecsls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import torch
1515
import torch.nn as nn
16-
import torch.nn.functional as F
1716

1817
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
1918
from timm.layers import create_classifier

timm/models/shvit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
year={2024}
1212
}
1313
"""
14-
import re
1514
from typing import Any, Dict, List, Optional, Set, Tuple, Union
1615

1716
import torch
@@ -429,7 +428,7 @@ def checkpoint_filter_fn(state_dict: Dict[str, torch.Tensor], model: nn.Module)
429428
state_dict = state_dict.get('model', state_dict)
430429

431430
# out_dict = {}
432-
#
431+
# import re
433432
# replace_rules = [
434433
# (re.compile(r'^blocks1\.'), 'stages.0.blocks.'),
435434
# (re.compile(r'^blocks2\.'), 'stages.1.blocks.'),

timm/models/swin_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
2626
from timm.layers import PatchEmbed, Mlp, DropPath, ClassifierHead, to_2tuple, to_ntuple, trunc_normal_, \
27-
_assert, use_fused_attn, resize_rel_pos_bias_table, resample_patch_embed, ndgrid
27+
use_fused_attn, resize_rel_pos_bias_table, resample_patch_embed, ndgrid
2828
from ._builder import build_model_with_cfg
2929
from ._features import feature_take_indices
3030
from ._features_fx import register_notrace_function

timm/models/swin_transformer_v2_cr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# --------------------------------------------------------
3030
import logging
3131
import math
32-
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
32+
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
3333

3434
import torch
3535
import torch.nn as nn

0 commit comments

Comments
 (0)