class_docstr: ResNet_I3D backbone.
  Inflated 3D model (I3D) from
  `"Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset"
  <https://arxiv.org/abs/1705.07750>`_ paper.
  Args:
      depth (int): Depth of ResNet, from {18, 34, 50, 101, 152}.
      num_stages (int): ResNet stages, normally 4.
      strides (Sequence[int]): Strides of the first block of each stage.
      dilations (Sequence[int]): Dilation of each stage.
      out_indices (Sequence[int]): Output from which stages.
      frozen_stages (int): Stages to be frozen (all param fixed). -1 means
          not freezing any parameters.
      bn_eval (bool): Whether to set BN layers to eval mode, namely, freeze
          running stats (mean and var).
      bn_frozen (bool): Whether to freeze weight and bias of BN layers.
class_docstr_tok: ["ResNet_I3D","backbone",".","Inflated","3D","model","(","I3D",")","from","`","``","Quo","Vadis",",","Action","Recognition","?","A","New","Model","and","the","Kinetics","Dataset","''","<","https",":","\/\/arxiv.org\/abs\/1705.07750",">","`","_","paper",".","Args",":","depth","(","int",")",":","Depth","of","ResNet",",","from","{","18",",","34",",","50",",","101",",","152","}",".","num_stages","(","int",")",":","ResNet","stages",",","normally","4.","strides","(","Sequence","[","int","]",")",":","Strides","of","the","first","block","of","each","stage",".","dilations","(","Sequence","[","int","]",")",":","Dilation","of","each","stage",".","out_indices","(","Sequence","[","int","]",")",":","Output","from","which","stages",".","frozen_stages","(","int",")",":","Stages","to","be","frozen","(","all","param","fixed",")",".","-1","means","not","freezing","any","parameters",".","bn_eval","(","bool",")",":","Whether","to","set","BN","layers","to","eval","mode",",","namely",",","freeze","running","stats","(","mean","and","var",")",".","bn_frozen","(","bool",")",":","Whether","to","freeze","weight","and","bias","of","BN","layers","."]
code: def forward(self, x):
      bs, _, _, _, _ = x.shape
      x = self.first_stage(x)
  
      for i, res_layer in enumerate(self.res_layers):
          x = res_layer(x)
          if i == 0:
              x = self.pool2(x)
  
      # spatial temporal average
      pooled_feat = self.st_avg(x)
      x = pooled_feat.view(bs, -1)
  
      if self.feat_ext:
          return x
  
      x = self.head(x)
      return x
  
imports: import torch
  import torch.nn
  from torch.nn import BatchNorm3d
  from .non_local import build_nonlocal_block
label_desc: Use image node_id 3 for calling the I3D_ResNetV1 obj's underlying member method code with example usage: obj.forward(x) and returns: x, x