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 forward(self, x):
      x = self.conv1_1(x)
      x = self.bn1_1(x)
      x = self.relu1_1(x)
  
      x = self.conv1_2(x)
      x = self.bn1_2(x)
      x = self.relu1_2(x)
  
      outs = []
      for i in range(4):
          layer_index = i + 2
          pool_layer = getattr(self, f"pool{layer_index}")
          block_layer = getattr(self, f"block{layer_index}")
          conv_layer = getattr(self, f"conv{layer_index}")
          bn_layer = getattr(self, f"bn{layer_index}")
          relu_layer = getattr(self, f"relu{layer_index}")
  
          if pool_layer is not None:
              x = pool_layer(x)
          x = block_layer(x)
          x = conv_layer(x)
          x = bn_layer(x)
          x = relu_layer(x)
  
          outs.append(x)
  
      if self.out_indices is not None:
          return tuple([outs[i] for i in self.out_indices])
  
      return x
  
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 3 for calling the ResNet31 obj's underlying member method code with example usage: obj.forward(x) and returns: x, tuple