class_docstr: Vision Transformer Model.
class_docstr_tok: ["Vision","Transformer","Model","."]
code: def __init__(
      self,
      model_cfg,
      model_parallel_config,
      num_classes,
      finetune=False,
      pre_process=True,
      post_process=True,
  ):
      super(VitClassificationModel, self).__init__()
  
      scaled_init_method = (
          scaled_init_method_normal(
              model_cfg.init_method_std, model_cfg.num_layers
          )
          if model_cfg.use_scaled_init_method
          else init_method_normal(model_cfg.init_method_std)
      )
  
      self.config = model_parallel_config
      self.hidden_size = model_cfg.hidden_size
      self.num_classes = num_classes
      self.finetune = finetune
      self.pre_process = pre_process
      self.post_process = post_process
      self.backbone = VitBackbone(
          model_cfg,
          model_parallel_config,
          init_method=init_method_normal(model_cfg.init_method_std),
          scaled_init_method=scaled_init_method,
          pre_process=self.pre_process,
          post_process=self.post_process,
          single_token_output=True,
      )
  
      if self.post_process:
          if not self.finetune:
              self.head = VitMlpHead(self.hidden_size, self.num_classes)
          else:
              self.head = get_linear_layer(
                  self.hidden_size,
                  self.num_classes,
                  torch.nn.init.zeros_,
              )
  
imports: import itertools
  from functools import partial
  from typing import Any, Optional
  import torch
  from omegaconf.dictconfig import DictConfig
  from pytorch_lightning.accelerators import CPUAccelerator
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.data.language_modeling.megatron.data_samplers import MegatronPretrainingSampler
  from nemo.collections.nlp.models.language_modeling.megatron_base_model import MegatronBaseModel
  from nemo.collections.nlp.modules.common.megatron.build_model import build_model
  from nemo.collections.nlp.modules.common.megatron.module import Float16Module, MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import average_losses_across_data_parallel_group, get_all_params_for_weight_decay_optimization, get_linear_layer, get_params_for_weight_decay_optimization, init_method_normal, scaled_init_method_normal
  from nemo.collections.nlp.parts.utils_funcs import get_last_rank, torch_dtype_from_precision
  from nemo.collections.vision.data.megatron.data_samplers import MegatronVisionPretrainingRandomSampler
  from nemo.collections.vision.data.megatron.vit_dataset import build_train_valid_datasets
  from nemo.collections.vision.modules.vit.vit_backbone import VitBackbone, VitMlpHead
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new VitClassificationModel object from inherited base classes: MegatronModule with example: obj = VitClassificationModel(model_cfg, model_parallel_config, num_classes, finetune, pre_process, post_process)