class_docstr: Model consisting of a backbone sequentially followed by an an MLP.
  Used for supervised finetuning of the SSL pre-trained models.
  
  Args:
      backbone (nn.Module): A model whole weights are conditionally
          updated based on the betach_backbone parameter.
      mlp (nn.Module): If specified, the MLP module to attach to the bacbone
          for the supervised finetuning phase.
      detach_bacbone: If true, detaches bacbone and no gradient are tracked and
          updated for the bacbone. Only updates the MLP weights during finetuning.
class_docstr_tok: ["Model","consisting","of","a","backbone","sequentially","followed","by","an","an","MLP",".","Used","for","supervised","finetuning","of","the","SSL","pre-trained","models",".","Args",":","backbone","(","nn.Module",")",":","A","model","whole","weights","are","conditionally","updated","based","on","the","betach_backbone","parameter",".","mlp","(","nn.Module",")",":","If","specified",",","the","MLP","module","to","attach","to","the","bacbone","for","the","supervised","finetuning","phase",".","detach_bacbone",":","If","true",",","detaches","bacbone","and","no","gradient","are","tracked","and","updated","for","the","bacbone",".","Only","updates","the","MLP","weights","during","finetuning","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      x = self.backbone(x)
      if self.detach_backbone:
          x = x.detach()
      if self.mlp is not None:
          x = self.mlp(x)
      return x
  
imports: import math
  from typing import Any, Callable, Dict, List, Optional
  import numpy
  import pytorchvideo_trainer.module.distributed_utils
  import torch
  import torch.nn
  import torch.nn.functional
  from hydra.utils import instantiate
  from pytorch_lightning.trainer import Trainer
  from pytorchvideo_trainer.module.video_classification import Batch, BatchKey, EnsembleMethod, VideoClassificationModule
label_desc: Use image node_id 2 for calling the SSLFineTuningModel obj's underlying member method code with example usage: obj.forward(x) and returns: x