class_docstr: Interface specifying what a ClassyVision video dataset is expected to provide.
  
  This dataset considers every video as a collection of video clips of fixed size,
  specified by ``frames_per_clip``, where the step in frames between each clip
  is given by ``step_between_clips``. It uses a clip sampler to sample
  a specified number of clips (``clips_per_video``) from each video.
  For training set, a random clip sampler is used to
  sample a small number of clips (e.g. 1) from each video
  For testing set, a uniform clip sampler is used to evenly sample a large
  number of clips (e.g. 10) from the video.
  
  To give an example, for 2 videos with 10 and 15 frames respectively,
  if ``frames_per_clip=5`` and ``step_between_clips=5``, the dataset size
  will be (2 + 3) = 5, where the first two elements will come from video 1,
  and the next three elements from video 2. Note that we drop clips which do
  not have exactly ``frames_per_clip`` elements, so not all frames in a video
  may be present.
class_docstr_tok: ["Interface","specifying","what","a","ClassyVision","video","dataset","is","expected","to","provide",".","This","dataset","considers","every","video","as","a","collection","of","video","clips","of","fixed","size",",","specified","by","``","frames_per_clip","``",",","where","the","step","in","frames","between","each","clip","is","given","by","``","step_between_clips","``",".","It","uses","a","clip","sampler","to","sample","a","specified","number","of","clips","(","``","clips_per_video","``",")","from","each","video",".","For","training","set",",","a","random","clip","sampler","is","used","to","sample","a","small","number","of","clips","(","e.g",".","1",")","from","each","video","For","testing","set",",","a","uniform","clip","sampler","is","used","to","evenly","sample","a","large","number","of","clips","(","e.g",".","10",")","from","the","video",".","To","give","an","example",",","for","2","videos","with","10","and","15","frames","respectively",",","if","``","frames_per_clip=5","``","and","``","step_between_clips=5","``",",","the","dataset","size","will","be","(","2","+","3",")","=","5",",","where","the","first","two","elements","will","come","from","video","1",",","and","the","next","three","elements","from","video","2",".","Note","that","we","drop","clips","which","do","not","have","exactly","``","frames_per_clip","``","elements",",","so","not","all","frames","in","a","video","may","be","present","."]
docstr: The constructor method of ClassyVideoDataset.
  
  Args:
      dataset: the underlying video dataset from either TorchVision or other
          source. It should have an attribute *video_clips* of type
          `torchvision.datasets.video_utils.VideoClips <https://github.com/
          pytorch/vision/blob/master/torchvision/datasets/
          video_utils.py#L46/>`_
      split: dataset split. Must be either "train" or "test"
      batchsize_per_replica: batch size per model replica
      shuffle: If true, shuffle video clips.
      transform: callable function to transform video clip sample from
          ClassyVideoDataset
      num_samples: If provided, return at most `num_samples` video clips
      clips_per_video: The number of clips sampled from each video
docstr_tok: ["The","constructor","method","of","ClassyVideoDataset",".","Args",":","dataset",":","the","underlying","video","dataset","from","either","TorchVision","or","other","source",".","It","should","have","an","attribute","*","video_clips","*","of","type","`","torchvision.datasets.video_utils.VideoClips","<","https",":","\/\/github.com\/","pytorch\/vision\/blob\/master\/torchvision\/datasets\/","video_utils.py","#","L46\/",">","`","_","split",":","dataset","split",".","Must","be","either","``","train","''","or","``","test","''","batchsize_per_replica",":","batch","size","per","model","replica","shuffle",":","If","true",",","shuffle","video","clips",".","transform",":","callable","function","to","transform","video","clip","sample","from","ClassyVideoDataset","num_samples",":","If","provided",",","return","at","most","`","num_samples","`","video","clips","clips_per_video",":","The","number","of","clips","sampled","from","each","video"]
code: def __init__(
      self,
      dataset: Any,
      split: str,
      batchsize_per_replica: int,
      shuffle: bool,
      transform: Callable,
      num_samples: Optional[int],
      clips_per_video: int,
  ):
      """The constructor method of ClassyVideoDataset.
  
      Args:
          dataset: the underlying video dataset from either TorchVision or other
              source. It should have an attribute *video_clips* of type
              `torchvision.datasets.video_utils.VideoClips <https://github.com/
              pytorch/vision/blob/master/torchvision/datasets/
              video_utils.py#L46/>`_
          split: dataset split. Must be either "train" or "test"
          batchsize_per_replica: batch size per model replica
          shuffle: If true, shuffle video clips.
          transform: callable function to transform video clip sample from
              ClassyVideoDataset
          num_samples: If provided, return at most `num_samples` video clips
          clips_per_video: The number of clips sampled from each video
  
      """
      super(ClassyVideoDataset, self).__init__(
          dataset,
          batchsize_per_replica,
          shuffle,
          transform,
          num_samples,
      )
      # Assignments:
      self.clips_per_video = clips_per_video
      self.split = split
      self.video_backend = get_video_backend()
  
imports: import logging
  import os
  from typing import Any, Callable, Dict, Optional
  import torch
  from classy_vision.generic.distributed_util import get_rank, get_world_size
  from torch.utils.data import Sampler
  from torchvision import get_video_backend
  from torchvision.datasets.samplers.clip_sampler import DistributedSampler, RandomClipSampler, UniformClipSampler
  from .classy_dataset import ClassyDataset
label_desc: Use image node_id 1 to create a new ClassyVideoDataset object from inherited base classes: ClassyDataset with example: obj = ClassyVideoDataset(dataset, split, batchsize_per_replica, shuffle, transform, num_samples, clips_per_video)