class_docstr: Given a list of transforms with weights, OpSampler applies weighted sampling to
  select n transforms, which are then applied sequentially to the input.
class_docstr_tok: ["Given","a","list","of","transforms","with","weights",",","OpSampler","applies","weighted","sampling","to","select","n","transforms",",","which","are","then","applied","sequentially","to","the","input","."]
docstr: Args:
      x (torch.Tensor): Input tensor.
docstr_tok: ["Args",":","x","(","torch.Tensor",")",":","Input","tensor","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """
      Args:
          x (torch.Tensor): Input tensor.
      """
      depth = (
          torch.randint(1, self.num_sample_op + 1, (1,)).item()
          if self.randomly_sample_depth
          else self.num_sample_op
      )
      index_list = torch.multinomial(
          self.transforms_prob, depth, replacement=self.replacement
      )
  
      for index in index_list:
          x = self.transforms_list[index](x)
  
      return x
  
imports: from typing import Callable, Dict, List, Optional, Tuple
  import pytorchvideo.transforms.functional
  import torch
  import torchvision.transforms
label_desc: Use image node_id 2 for calling the OpSampler obj's underlying member method code with example usage: obj.forward(x) and returns: x