code: def __init__(self, cfg, **kwargs):
      super(vit_base_patch16_224, self).__init__()
      self.pretrained = True
      patch_size = 16
      self.model = VisionTransformer(
          img_size=cfg.DATA.TRAIN_CROP_SIZE,
          num_classes=cfg.MODEL.NUM_CLASSES,
          patch_size=patch_size,
          embed_dim=768,
          depth=12,
          num_heads=12,
          mlp_ratio=4,
          qkv_bias=True,
          norm_layer=partial(nn.LayerNorm, eps=1e-6),
          drop_rate=0.0,
          attn_drop_rate=0.0,
          drop_path_rate=0.1,
          num_frames=cfg.DATA.NUM_FRAMES,
          attention_type=cfg.TIMESFORMER.ATTENTION_TYPE,
          **kwargs,
      )
  
      self.attention_type = cfg.TIMESFORMER.ATTENTION_TYPE
      self.model.default_cfg = default_cfgs["vit_base_patch16_224"]
      self.num_patches = (cfg.DATA.TRAIN_CROP_SIZE // patch_size) * (
          cfg.DATA.TRAIN_CROP_SIZE // patch_size
      )
      pretrained_model = cfg.TIMESFORMER.PRETRAINED_MODEL
      if self.pretrained:
          load_pretrained(
              self.model,
              num_classes=self.model.num_classes,
              in_chans=kwargs.get("in_chans", 3),
              filter_fn=_conv_filter,
              img_size=cfg.DATA.TRAIN_CROP_SIZE,
              num_patches=self.num_patches,
              attention_type=self.attention_type,
              pretrained_model=pretrained_model,
          )
  
imports: import logging
  from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils
  import torch.utils.checkpoint
  from einops import rearrange
  from fairscale.nn.checkpoint.checkpoint_activations import checkpoint_wrapper
  from .helpers import load_pretrained, load_pretrained_imagenet, load_pretrained_kinetics
  from .vit_utils import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, DropPath, to_2tuple, trunc_normal_
label_desc: Use image node_id 1 to create a new vit_base_patch16_224 object from inherited base classes: nn with example: obj = vit_base_patch16_224(cfg)