class_docstr: Task that classifies videos.
  
  Args:
      num_classes: Number of classes to classify.
      backbone: A string mapped to ``pytorch_video`` backbones or ``nn.Module``, defaults to ``"x3d_xs"``.
      backbone_kwargs: Arguments to customize the backbone from PyTorchVideo.
      pretrained: Use a pretrained backbone, defaults to ``True``.
      loss_fn: Loss function for training, defaults to :func:`torch.nn.functional.cross_entropy`.
      optimizer: Optimizer to use for training, defaults to :class:`torch.optim.SGD`.
  
      lr_scheduler: The scheduler or scheduler class to use.
  
      metrics: Metrics to compute for training and evaluation. Can either be an metric from the `torchmetrics`
          package, a custom metric inherenting from `torchmetrics.Metric`, a callable function or a list/dict
          containing a combination of the aforementioned. In all cases, each metric needs to have the signature
          `metric(preds,target)` and return a single scalar tensor. Defaults to :class:`torchmetrics.Accuracy`.
      learning_rate: Learning rate to use for training, defaults to ``1e-3``.
      head: either a `nn.Module` or a callable function that converts the features extrated from the backbone
          into class log probabilities (assuming default loss function). If `None`, will default to using
          a single linear layer.
code: def on_train_epoch_start(self) -> None:
      if accelerator_connector(self.trainer).is_distributed:
          encoded_dataset = (
              self.trainer.train_dataloader.loaders.dataset.data
          )
          encoded_dataset._video_sampler.set_epoch(
              self.trainer.current_epoch
          )
      super().on_train_epoch_start()
  
imports: from types import FunctionType
  from typing import Any, Dict, Iterable, List, Optional, Union
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.utils.data import DistributedSampler
  from torchmetrics import Accuracy
  import flash
  from flash.core.classification import ClassificationTask
  from flash.core.data.io.input import DataKeys
  from flash.core.registry import FlashRegistry
  from flash.core.utilities.compatibility import accelerator_connector
  from flash.core.utilities.imports import _PYTORCHVIDEO_AVAILABLE
  from flash.core.utilities.providers import _PYTORCHVIDEO
  from flash.core.utilities.types import LOSS_FN_TYPE, LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
label_desc: Use image node_id 3 for calling the VideoClassifier obj's underlying member method code with example usage: obj.on_train_epoch_start() without return types