code: def _create_deit(
      variant, pretrained=False, distilled=False, **kwargs
  ):
      if kwargs.get("features_only", None):
          raise RuntimeError(
              "features_only not implemented for Vision Transformer models."
          )
      model_cls = (
          VisionTransformerDistilled if distilled else VisionTransformer
      )
      model = build_model_with_cfg(
          model_cls,
          variant,
          pretrained,
          pretrained_filter_fn=partial(
              checkpoint_filter_fn, adapt_layer_scale=True
          ),
          **kwargs,
      )
      return model
  
imports: from functools import partial
  from typing import Sequence, Union
  import torch
  from torch import nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import resample_abs_pos_embed
  from timm.models.vision_transformer import VisionTransformer, trunc_normal_, checkpoint_filter_fn
  from ._builder import build_model_with_cfg
  from ._manipulate import checkpoint_seq
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 1 for calling a global function with example usage: _create_deit(variant, pretrained, distilled) and returns: model