class_docstr: The Lightning Base module for SimCLR SSL video task.
  
  For more details refer to,
  1. A Simple Framework for Contrastive Learning of Visual Representations :
      https://arxiv.org/abs/2002.05709
  2. A Large-Scale Study on Unsupervised Spatiotemporal Representation Learning
  
  Args:
      model (OmegaConf): An omega conf object intializing the neural-network modle.
          Example configs can be found in `pytorchvideo_trainer/conf/module/model`
      loss(OmegaConf): An omega conf object intializing the loss function.
          Example configs can be found in `pytorchvideo_trainer/conf/module/loss`
      optim (OmegaConf): An omega conf object for constructing the optimizer object.
          The associated config schema can be found at
          `pytorchvideo_trainer.module.optimizer.OptimizerConf`.
          Example configs can be found in `pytorchvideo_trainer/conf/module/optim`
      metrics (OmegaConf): The metrics to track, which will be used for both train,
          validation and test. Example configs can be found in
          `pytorchvideo_trainer/conf/module/metricx`
      lr_scheduler (OmegaConf): An omega conf object associated with learning rate
          scheduler used during trainer.
          The associated config schema can be found at
          `pytorchvideo_trainer.module.lr_policy.LRSchedulerConf`.
          Example configs can be found in `pytorchvideo_trainer/conf/module/lr_scheduler`
      modality_key (str): The modality key used in data processing, default: "video".
      ensemble_method (str): The data ensembling method to control how we accumulate
          the testing results at video level, which is optional. Users may choose from
          ["sum", "max", None], If it is set to None, no data ensembling will be applied.
      knn_memory (OmegaConf): An optional hydra / omeaga conf, if set, initializes KNN
          Memory module to use. Example config can be found at,
          `pytorchvideo_trainer/conf/module/knn_memory`.
      num_sync_devices (int): Number of gpus to sync bathcnorm over. Only works if
          pytorch lightning trainer's sync_batchnorm parameter is to false.
code: def training_step(
      self, batch: Batch, batch_idx: int, *args: Any, **kwargs: Any
  ) -> None:
      self.cur_epoch_step += 1  # pyre-ignore[16]
  
      self.manual_zero_opt_grad()
      self.manual_update_lr()
  
      inputs = batch[self.modality_key]  # pyre-ignore[6]
      partial_loss = 0.0
      for i in range(len(inputs) - 1):
          y_hat = self(inputs[i : i + 2])
          loss = self.loss(y_hat)
          self.manual_backward(loss)
          partial_loss += loss.detach()
  
      partial_loss /= len(inputs) - 1
      self.log(
          "Losses/train_loss", partial_loss, on_step=True, on_epoch=True
      )
  
      if self.knn_memory is not None:
          # pyre-ignore[29]
          self.knn_memory.update(y_hat[0], batch["video_index"])
  
      self.manual_opt_step()
  
imports: from dataclasses import dataclass
  from typing import Any, Callable, List, Optional, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from hydra.core.config_store import ConfigStore
  from omegaconf import MISSING
  from pytorchvideo.models.resnet import create_resnet
  from pytorchvideo.models.weight_init import init_net_weights
  from pytorchvideo_trainer.module.byol import create_mlp_util
  from pytorchvideo_trainer.module.ssl_helper import SSLBaseModule
  from pytorchvideo_trainer.module.video_classification import Batch, BatchKey, EnsembleMethod
  from torchrecipes.core.conf import ModuleConf
  from torchrecipes.utils.config_utils import get_class_name_str
label_desc: Use image node_id 2 for calling the SimCLRModule obj's underlying member method code with example usage: obj.training_step(batch, batch_idx) without return types