class_docstr: Implement ResNet backbone for text recognition, modified from
    `ResNet <https://arxiv.org/pdf/1512.03385.pdf>`_
  Args:
      base_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.
      stage4_pool_cfg (dict): Dictionary to construct and configure
          pooling layer in stage 4.
      last_stage_pool (bool): If True, add `MaxPool2d` layer to last stage.
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: mmocr/mmocr/models/textrecog/backbones/resnet31_ocr.py
imports: import torch.nn
  from mmengine.model import BaseModule, Sequential
  import mmocr.utils
  from mmocr.models.textrecog.layers import BasicBlock
  from mmocr.registry import MODELS
label_desc: Use image node_id 3 for calling the ResNet31OCR obj's underlying member method code with example usage: obj.forward(x) and returns: x, tuple