class_docstr: The Pseudo 3D network (P3D).
  Learning Spatio-Temporal Representation with Pseudo-3D Residual Networks.
  ICCV, 2017. https://arxiv.org/abs/1711.10305
  
  Parameters
  ----------
  nclass : int
      Number of classes in the training dataset.
  block : Block, default is `Bottleneck`.
      Class for the residual block.
  layers : list of int
      Numbers of layers in each block
  block_design : tuple of str.
      Different designs for each block, from 'A', 'B' or 'C'.
  dropout_ratio : float, default is 0.5.
      The dropout rate of a dropout layer.
      The larger the value, the more strength to prevent overfitting.
  num_segments : int, default is 1.
      Number of segments used to evenly divide a video.
  num_crop : int, default is 1.
      Number of crops used during evaluation, choices are 1, 3 or 10.
  feat_ext : bool.
      Whether to extract features before dense classification layer or
      do a complete forward pass.
  init_std : float, default is 0.001.
      Standard deviation value when initialize the dense layers.
  ctx : Context, default CPU.
      The context in which to load the pretrained weights.
  partial_bn : bool, default False.
      Freeze all batch normalization layers during training except the first layer.
  norm_layer : object
      Normalization layer used (default: :class:`mxnet.gluon.nn.BatchNorm`)
      Can be :class:`mxnet.gluon.nn.BatchNorm` or :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
  norm_kwargs : dict
      Additional `norm_layer` arguments, for example `num_devices=4`
      for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
class_docstr_tok: ["The","Pseudo","3D","network","(","P3D",")",".","Learning","Spatio-Temporal","Representation","with","Pseudo-3D","Residual","Networks",".","ICCV",",","2017.","https",":","\/\/arxiv.org\/abs\/1711.10305","Parameters","--","--","--","--","--","nclass",":","int","Number","of","classes","in","the","training","dataset",".","block",":","Block",",","default","is","`","Bottleneck","`",".","Class","for","the","residual","block",".","layers",":","list","of","int","Numbers","of","layers","in","each","block","block_design",":","tuple","of","str",".","Different","designs","for","each","block",",","from","'","A","'",",","'","B","'","or","'","C","'",".","dropout_ratio",":","float",",","default","is","0.5",".","The","dropout","rate","of","a","dropout","layer",".","The","larger","the","value",",","the","more","strength","to","prevent","overfitting",".","num_segments",":","int",",","default","is","1",".","Number","of","segments","used","to","evenly","divide","a","video",".","num_crop",":","int",",","default","is","1",".","Number","of","crops","used","during","evaluation",",","choices","are","1",",","3","or","10.","feat_ext",":","bool",".","Whether","to","extract","features","before","dense","classification","layer","or","do","a","complete","forward","pass",".","init_std",":","float",",","default","is","0.001",".","Standard","deviation","value","when","initialize","the","dense","layers",".","ctx",":","Context",",","default","CPU",".","The","context","in","which","to","load","the","pretrained","weights",".","partial_bn",":","bool",",","default","False",".","Freeze","all","batch","normalization","layers","during","training","except","the","first","layer",".","norm_layer",":","object","Normalization","layer","used","(","default",":",":","class",":","`","mxnet.gluon.nn.BatchNorm","`",")","Can","be",":","class",":","`","mxnet.gluon.nn.BatchNorm","`","or",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`",".","norm_kwargs",":","dict","Additional","`","norm_layer","`","arguments",",","for","example","`","num_devices=4","`","for",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`","."]
docstr: Build each stage of a ResNet
docstr_tok: ["Build","each","stage","of","a","ResNet"]
code: def _make_res_layer(
      self,
      block,
      planes,
      blocks,
      shortcut_type="B",
      block_design=("A", "B", "C"),
      spatial_stride=1,
      temporal_stride=1,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      layer_name="",
  ):
      """Build each stage of a ResNet"""
      downsample = None
  
      if self.layer_cnt < self.depth_3d:
          if (
              spatial_stride != 1
              or self.inplanes != planes * block.expansion
          ):
              downsample = nn.HybridSequential(
                  prefix=layer_name + "downsample_"
              )
              with downsample.name_scope():
                  downsample.add(
                      nn.Conv3D(
                          in_channels=self.inplanes,
                          channels=planes * block.expansion,
                          kernel_size=1,
                          strides=(
                              temporal_stride,
                              spatial_stride,
                              spatial_stride,
                          ),
                          use_bias=False,
                      )
                  )
                  downsample.add(
                      norm_layer(
                          in_channels=planes * block.expansion,
                          **(
                              {} if norm_kwargs is None else norm_kwargs
                          ),
                      )
                  )
      else:
          if (
              spatial_stride != 1
              or self.inplanes != planes * block.expansion
          ):
              downsample = nn.HybridSequential(
                  prefix=layer_name + "downsample_"
              )
              with downsample.name_scope():
                  downsample.add(
                      nn.Conv2D(
                          in_channels=self.inplanes,
                          channels=planes * block.expansion,
                          kernel_size=1,
                          strides=spatial_stride,
                          use_bias=False,
                      )
                  )
                  downsample.add(
                      norm_layer(
                          in_channels=planes * block.expansion,
                          **(
                              {} if norm_kwargs is None else norm_kwargs
                          ),
                      )
                  )
  
      layers = nn.HybridSequential(prefix=layer_name)
      with layers.name_scope():
          layers.add(
              block(
                  inplanes=self.inplanes,
                  planes=planes,
                  spatial_stride=spatial_stride,
                  temporal_stride=temporal_stride,
                  downsample=downsample,
                  num_layers=self.layer_cnt,
                  depth_3d=self.depth_3d,
                  block_design=block_design,
              )
          )
  
          self.layer_cnt += 1
          self.inplanes = planes * block.expansion
          for _ in range(1, blocks):
              layers.add(
                  block(
                      inplanes=self.inplanes,
                      planes=planes,
                      spatial_stride=1,
                      temporal_stride=1,
                      num_layers=self.layer_cnt,
                      depth_3d=self.depth_3d,
                      block_design=block_design,
                  )
              )
              self.layer_cnt += 1
      return layers
  
imports: from mxnet import init
  from mxnet.context import cpu
  from mxnet.gluon.block import HybridBlock
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
label_desc: Use image node_id 2 for calling the P3D obj's underlying member method code with example usage: obj._make_res_layer(block, planes, blocks, shortcut_type, block_design, spatial_stride, temporal_stride, norm_layer, norm_kwargs, layer_name) and returns: layers