class_docstr: Given a list of video files, computes all consecutive subvideos of size
  `clip_length_in_frames`, where the distance between each subvideo in the
  same video is defined by `frames_between_clips`.
  If `frame_rate` is specified, it will also resample all the videos to have
  the same frame rate, and the clips will refer to this frame rate.
  
  Creating this instance the first time is time-consuming, as it needs to
  decode all the videos in `video_paths`. It is recommended that you
  cache the results after instantiation of the class.
  
  Recreating the clips for different clip lengths is fast, and can be done
  with the `compute_clips` method.
  
  Args:
      video_paths (List[str]): paths to the video files
      clip_length_in_frames (int): size of a clip in number of frames
      frames_between_clips (int): step (in frames) between each clip
      frame_rate (int, optional): if specified, it will resample the video
          so that it has `frame_rate`, and then the clips will be defined
          on the resampled video
      num_workers (int): how many subprocesses to use for data loading.
          0 means that the data will be loaded in the main process. (default: 0)
      output_format (str): The format of the output video tensors. Can be either "THWC" (default) or "TCHW".
docstr: Compute all consecutive sequences of clips from video_pts.
  Always returns clips of size `num_frames`, meaning that the
  last few frames in a video can potentially be dropped.
  
  Args:
      num_frames (int): number of frames for the clip
      step (int): distance between two clips
      frame_rate (int, optional): The frame rate
docstr_tok: ["Compute","all","consecutive","sequences","of","clips","from","video_pts",".","Always","returns","clips","of","size","`","num_frames","`",",","meaning","that","the","last","few","frames","in","a","video","can","potentially","be","dropped",".","Args",":","num_frames","(","int",")",":","number","of","frames","for","the","clip","step","(","int",")",":","distance","between","two","clips","frame_rate","(","int",",","optional",")",":","The","frame","rate"]
code: def compute_clips(
      self, num_frames: int, step: int, frame_rate: Optional[int] = None
  ) -> None:
      """
      Compute all consecutive sequences of clips from video_pts.
      Always returns clips of size `num_frames`, meaning that the
      last few frames in a video can potentially be dropped.
  
      Args:
          num_frames (int): number of frames for the clip
          step (int): distance between two clips
          frame_rate (int, optional): The frame rate
      """
      self.num_frames = num_frames
      self.step = step
      self.frame_rate = frame_rate
      self.clips = []
      self.resampling_idxs = []
      for video_pts, fps in zip(self.video_pts, self.video_fps):
          clips, idxs = self.compute_clips_for_video(
              video_pts, num_frames, step, fps, frame_rate
          )
          self.clips.append(clips)
          self.resampling_idxs.append(idxs)
      clip_lengths = torch.as_tensor([len(v) for v in self.clips])
      self.cumulative_sizes = clip_lengths.cumsum(0).tolist()
  
imports: import bisect
  import math
  import warnings
  from fractions import Fraction
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple, TypeVar, Union
  import torch
  from torchvision.io import _probe_video_from_file, _read_video_from_file, read_video, read_video_timestamps
  from .utils import tqdm
label_desc: Use image node_id 7 for calling the VideoClips obj's underlying member method code with example usage: obj.compute_clips(num_frames, step, frame_rate) without return types