docstr: Generic resnet video generator.
  
  Args:
      block (Type[Union[BasicBlock, Bottleneck]]): resnet building block
      conv_makers (List[Type[Union[Conv3DSimple, Conv3DNoTemporal, Conv2Plus1D]]]): generator
          function for each layer
      layers (List[int]): number of blocks per layer
      stem (Callable[..., nn.Module]): module specifying the ResNet stem.
      num_classes (int, optional): Dimension of the final FC layer. Defaults to 400.
      zero_init_residual (bool, optional): Zero init bottleneck residual BN. Defaults to False.
docstr_tok: ["Generic","resnet","video","generator",".","Args",":","block","(","Type","[","Union","[","BasicBlock",",","Bottleneck","]","]",")",":","resnet","building","block","conv_makers","(","List","[","Type","[","Union","[","Conv3DSimple",",","Conv3DNoTemporal",",","Conv2Plus1D","]","]","]",")",":","generator","function","for","each","layer","layers","(","List","[","int","]",")",":","number","of","blocks","per","layer","stem","(","Callable","[","...",",","nn.Module","]",")",":","module","specifying","the","ResNet","stem",".","num_classes","(","int",",","optional",")",":","Dimension","of","the","final","FC","layer",".","Defaults","to","400.","zero_init_residual","(","bool",",","optional",")",":","Zero","init","bottleneck","residual","BN",".","Defaults","to","False","."]
code: def __init__(
      self,
      block: Type[Union[BasicBlock, Bottleneck]],
      conv_makers: Sequence[
          Type[Union[Conv3DSimple, Conv3DNoTemporal, Conv2Plus1D]]
      ],
      layers: List[int],
      stem: Callable[..., nn.Module],
      num_classes: int = 400,
      zero_init_residual: bool = False,
  ) -> None:
      """Generic resnet video generator.
  
      Args:
          block (Type[Union[BasicBlock, Bottleneck]]): resnet building block
          conv_makers (List[Type[Union[Conv3DSimple, Conv3DNoTemporal, Conv2Plus1D]]]): generator
              function for each layer
          layers (List[int]): number of blocks per layer
          stem (Callable[..., nn.Module]): module specifying the ResNet stem.
          num_classes (int, optional): Dimension of the final FC layer. Defaults to 400.
          zero_init_residual (bool, optional): Zero init bottleneck residual BN. Defaults to False.
      """
      super().__init__()
      _log_api_usage_once(self)
      self.inplanes = 64
  
      self.stem = stem()
  
      self.layer1 = self._make_layer(
          block, conv_makers[0], 64, layers[0], stride=1
      )
      self.layer2 = self._make_layer(
          block, conv_makers[1], 128, layers[1], stride=2
      )
      self.layer3 = self._make_layer(
          block, conv_makers[2], 256, layers[2], stride=2
      )
      self.layer4 = self._make_layer(
          block, conv_makers[3], 512, layers[3], stride=2
      )
  
      self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
      self.fc = nn.Linear(512 * block.expansion, num_classes)
  
      # init weights
      for m in self.modules():
          if isinstance(m, nn.Conv3d):
              nn.init.kaiming_normal_(
                  m.weight, mode="fan_out", nonlinearity="relu"
              )
              if m.bias is not None:
                  nn.init.constant_(m.bias, 0)
          elif isinstance(m, nn.BatchNorm3d):
              nn.init.constant_(m.weight, 1)
              nn.init.constant_(m.bias, 0)
          elif isinstance(m, nn.Linear):
              nn.init.normal_(m.weight, 0, 0.01)
              nn.init.constant_(m.bias, 0)
  
      if zero_init_residual:
          for m in self.modules():
              if isinstance(m, Bottleneck):
                  nn.init.constant_(m.bn3.weight, 0)
  
imports: from functools import partial
  from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
  import torch.nn
  from torch import Tensor
  from ...transforms._presets import VideoClassification
  from ...utils import _log_api_usage_once
  from .._api import register_model, Weights, WeightsEnum
  from .._meta import _KINETICS400_CATEGORIES
  from .._utils import _ovewrite_named_param, handle_legacy_interface
  from .._utils import _ModelURLs
label_desc: Use image node_id 1 to create a new VideoResNet object from inherited base classes: nn with example: obj = VideoResNet(block, conv_makers, layers, stem, num_classes, zero_init_residual)