class_docstr: The R2+1D network.
  A Closer Look at Spatiotemporal Convolutions for Action Recognition.
  CVPR, 2018. https://arxiv.org/abs/1711.11248
class_docstr_tok: ["The","R2+1D","network",".","A","Closer","Look","at","Spatiotemporal","Convolutions","for","Action","Recognition",".","CVPR",",","2018.","https",":","\/\/arxiv.org\/abs\/1711.11248"]
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=BatchNorm3d,
      norm_kwargs=None,
      layer_name="",
  ):
      """Build each stage of a ResNet"""
      downsample = None
  
      if stride != 1 or self.inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              nn.Conv3d(
                  in_channels=self.inplanes,
                  out_channels=planes * block.expansion,
                  kernel_size=1,
                  stride=(stride, stride, stride),
                  bias=False,
              ),
              norm_layer(
                  num_features=planes * block.expansion,
                  **({} if norm_kwargs is None else norm_kwargs),
              ),
          )
  
      layers = []
      layers.append(
          block(
              inplanes=self.inplanes,
              planes=planes,
              stride=stride,
              downsample=downsample,
          )
      )
  
      self.inplanes = planes * block.expansion
      for _ in range(1, blocks):
          layers.append(block(inplanes=self.inplanes, planes=planes))
  
      return nn.Sequential(*layers)
  
imports: import torch
  import torch.nn
  from torch.nn import BatchNorm3d
label_desc: Use image node_id 2 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: nn