code: def _vit(
      arch: str,
      pretrained: bool,
      **kwargs: Any,
  ) -> VisionTransformer:
      kwargs["num_classes"] = kwargs.get(
          "num_classes", len(default_cfgs[arch]["classes"])
      )
      kwargs["input_shape"] = kwargs.get(
          "input_shape", default_cfgs[arch]["input_shape"]
      )
      kwargs["classes"] = kwargs.get(
          "classes", default_cfgs[arch]["classes"]
      )
  
      _cfg = deepcopy(default_cfgs[arch])
      _cfg["num_classes"] = kwargs["num_classes"]
      _cfg["input_shape"] = kwargs["input_shape"]
      _cfg["classes"] = kwargs["classes"]
      kwargs.pop("classes")
  
      # Build the model
      model = VisionTransformer(cfg=_cfg, **kwargs)
      # Load pretrained parameters
      if pretrained:
          load_pretrained_params(model, default_cfgs[arch]["url"])
  
      return model
  
file_path: doctr/doctr/models/classification/vit/tensorflow.py
imports: from copy import deepcopy
  from typing import Any, Dict, Optional, Tuple
  import tensorflow
  from tensorflow.keras import Sequential, layers
  from doctr.datasets import VOCABS
  from doctr.models.modules.transformer import EncoderBlock
  from doctr.models.modules.vision_transformer.tensorflow import PatchEmbedding
  from doctr.utils.repr import NestedObject
  from ...utils import load_pretrained_params
label_desc: Use image node_id 1 for calling a global function with example usage: _vit(arch, pretrained) and returns: model