class_docstr: The R2+1D network.
  A Closer Look at Spatiotemporal Convolutions for Action Recognition.
  CVPR, 2018. https://arxiv.org/abs/1711.11248
  
  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
  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","R2+1D","network",".","A","Closer","Look","at","Spatiotemporal","Convolutions","for","Action","Recognition",".","CVPR",",","2018.","https",":","\/\/arxiv.org\/abs\/1711.11248","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","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,
      stride=1,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      layer_name="",
  ):
      """Build each stage of a ResNet"""
      downsample = None
  
      if 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=(stride, stride, 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,
                  stride=stride,
                  downsample=downsample,
              )
          )
  
          self.inplanes = planes * block.expansion
          for _ in range(1, blocks):
              layers.add(block(inplanes=self.inplanes, planes=planes))
  
      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 3 for calling the R2Plus1D obj's underlying member method code with example usage: obj._make_res_layer(block, planes, blocks, stride, norm_layer, norm_kwargs, layer_name) and returns: layers