code: def _create_crossvit(variant, pretrained=False, **kwargs):
      if kwargs.get("features_only", None):
          raise RuntimeError(
              "features_only not implemented for Vision Transformer models."
          )
  
      def pretrained_filter_fn(state_dict):
          new_state_dict = {}
          for key in state_dict.keys():
              if "pos_embed" in key or "cls_token" in key:
                  new_key = key.replace(".", "_")
              else:
                  new_key = key
              new_state_dict[new_key] = state_dict[key]
          return new_state_dict
  
      return build_model_with_cfg(
          CrossVit,
          variant,
          pretrained,
          pretrained_filter_fn=pretrained_filter_fn,
          **kwargs,
      )
  
imports: from functools import partial
  from typing import List
  from typing import Tuple
  import torch
  import torch.hub
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import DropPath, to_2tuple, trunc_normal_, _assert
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_function
  from ._registry import register_model, generate_default_cfgs
  from .vision_transformer import Block
label_desc: Use image node_id 3 for calling a global function with example usage: _create_crossvit(variant, pretrained) and returns: build_model_with_cfg, new_state_dict