Imports getting unwieldy in vision_transformer.py

This commit is contained in:
Ross Wightman 2025-05-30 15:11:51 -07:00
parent 1be7999993
commit 211cf90721

View File

@ -39,11 +39,30 @@ import torch.nn as nn
import torch.nn.functional as F
from torch.jit import Final
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD, \
from timm.data import (
IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD,
IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD,
OPENAI_CLIP_MEAN, OPENAI_CLIP_STD
from timm.layers import PatchEmbed, Mlp, DropPath, AttentionPoolLatent, LayerNorm, RmsNorm, PatchDropout, \
SwiGLUPacked, SwiGLU, trunc_normal_, lecun_normal_, resample_patch_embed, resample_abs_pos_embed, use_fused_attn, \
get_act_layer, get_norm_layer, LayerType
)
from timm.layers import (
PatchEmbed,
Mlp,
DropPath,
AttentionPoolLatent,
LayerNorm,
RmsNorm,
PatchDropout,
SwiGLUPacked,
SwiGLU,
trunc_normal_,
lecun_normal_,
resample_patch_embed,
resample_abs_pos_embed,
use_fused_attn,
get_act_layer,
get_norm_layer,
LayerType,
)
from ._builder import build_model_with_cfg
from ._features import feature_take_indices
from ._manipulate import named_apply, checkpoint_seq, adapt_input_conv