class_docstr: Args:
      in_channels (int): Number of channels of input image tensor.
      layers (list[int]): List of BasicBlock number for each stage.
      channels (list[int]): List of out_channels of Conv2d layer.
      out_indices (None | Sequence[int]): Indices of output stages.
      last_stage_pool (bool): If True, add `MaxPool2d` layer to last stage.
      init_type (None | str): the config to control the initialization.
class_docstr_tok: ["Args",":","in_channels","(","int",")",":","Number","of","channels","of","input","image","tensor",".","layers","(","list","[","int","]",")",":","List","of","BasicBlock","number","for","each","stage",".","channels","(","list","[","int","]",")",":","List","of","out_channels","of","Conv2d","layer",".","out_indices","(","None","|","Sequence","[","int","]",")",":","Indices","of","output","stages",".","last_stage_pool","(","bool",")",":","If","True",",","add","`","MaxPool2d","`","layer","to","last","stage",".","init_type","(","None","|","str",")",":","the","config","to","control","the","initialization","."]
code: def _make_layer(
      self,
      input_channels,
      output_channels,
      blocks,
      conv_weight_attr=None,
      bn_weight_attr=None,
  ):
      layers = []
      for _ in range(blocks):
          downsample = None
          if input_channels != output_channels:
              downsample = nn.Sequential(
                  nn.Conv2D(
                      input_channels,
                      output_channels,
                      kernel_size=1,
                      stride=1,
                      weight_attr=conv_weight_attr,
                      bias_attr=False,
                  ),
                  nn.BatchNorm2D(
                      output_channels, weight_attr=bn_weight_attr
                  ),
              )
  
          layers.append(
              BasicBlock(
                  input_channels,
                  output_channels,
                  downsample=downsample,
                  conv_weight_attr=conv_weight_attr,
                  bn_weight_attr=bn_weight_attr,
              )
          )
          input_channels = output_channels
      return nn.Sequential(*layers)
  
file_path: PaddleOCR/ppocr/modeling/backbones/rec_resnet_31.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  import numpy
label_desc: Use image node_id 2 for calling the ResNet31 obj's underlying member method code with example usage: obj._make_layer(input_channels, output_channels, blocks, conv_weight_attr, bn_weight_attr) and returns: nn