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: Hybrid forward of R2+1D net
docstr_tok: ["Hybrid","forward","of","R2+1D","net"]
code: def hybrid_forward(self, F, x):
      """Hybrid forward of R2+1D net"""
      x = self.conv1(x)
      x = self.bn1(x)
      x = self.relu(x)
      x = self.conv2(x)
      x = self.bn2(x)
      x = self.relu(x)
  
      x = self.layer1(x)
      x = self.layer2(x)
      x = self.layer3(x)
      x = self.layer4(x)
  
      x = self.avgpool(x)
      x = F.squeeze(x, axis=(2, 3, 4))
  
      # segmental consensus
      x = F.reshape(
          x,
          shape=(-1, self.num_segments * self.num_crop, self.feat_dim),
      )
      x = F.mean(x, axis=1)
  
      if self.feat_ext:
          return x
  
      x = self.fc(self.dropout(x))
      return x
  
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 R2Plus1D obj's underlying member method code with example usage: obj.hybrid_forward(F, x) and returns: x, x