class_docstr: Implement ResNet backbone for text recognition, modified from `ResNet.
  
  <https://arxiv.org/pdf/1512.03385.pdf>`_ and
  `<https://github.com/FangShancheng/ABINet>`_
  
  Args:
      in_channels (int): Number of channels of input image tensor.
      stem_channels (int): Number of stem channels.
      base_channels (int): Number of base channels.
      arch_settings  (list[int]): List of BasicBlock number for each stage.
      strides (Sequence[int]): Strides of the first block of each stage.
      out_indices (None | Sequence[int]): Indices of output stages. If not
          specified, only the last stage will be returned.
      last_stage_pool (bool): If True, add `MaxPool2d` layer to last stage.
code: def __init__(
      self,
      in_channels=3,
      stem_channels=32,
      base_channels=32,
      arch_settings=[3, 4, 6, 6, 3],
      strides=[2, 1, 2, 1, 1],
      out_indices=None,
      last_stage_pool=False,
      init_cfg=[
          dict(type="Xavier", layer="Conv2d"),
          dict(type="Constant", val=1, layer="BatchNorm2d"),
      ],
  ):
      super().__init__(init_cfg=init_cfg)
      assert isinstance(in_channels, int)
      assert isinstance(stem_channels, int)
      assert utils.is_type_list(arch_settings, int)
      assert utils.is_type_list(strides, int)
      assert len(arch_settings) == len(strides)
      assert out_indices is None or isinstance(
          out_indices, (list, tuple)
      )
      assert isinstance(last_stage_pool, bool)
  
      self.out_indices = out_indices
      self.last_stage_pool = last_stage_pool
      self.block = BasicBlock
      self.inplanes = stem_channels
  
      self._make_stem_layer(in_channels, stem_channels)
  
      self.res_layers = []
      planes = base_channels
      for i, num_blocks in enumerate(arch_settings):
          stride = strides[i]
          res_layer = self._make_layer(
              block=self.block,
              inplanes=self.inplanes,
              planes=planes,
              blocks=num_blocks,
              stride=stride,
          )
          self.inplanes = planes * self.block.expansion
          planes *= 2
          layer_name = f"layer{i + 1}"
          self.add_module(layer_name, res_layer)
          self.res_layers.append(layer_name)
  
file_path: mmocr/mmocr/models/textrecog/backbones/resnet_abi.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 1 to create a new ResNetABI object from inherited base classes: BaseModule with example: obj = ResNetABI(in_channels, stem_channels, base_channels, arch_settings, strides, out_indices, last_stage_pool, init_cfg)