class_docstr: Modality transform in NRTR.
  
  Args:
      in_channels (int): Input channel of image. Defaults to 3.
      init_cfg (dict or list[dict], optional): Initialization configs.
code: def __init__(
      self,
      in_channels: int = 3,
      init_cfg: Optional[Union[Dict, Sequence[Dict]]] = [
          dict(type="Kaiming", layer="Conv2d"),
          dict(type="Uniform", layer="BatchNorm2d"),
      ],
  ) -> None:
      super().__init__(init_cfg=init_cfg)
  
      self.conv_1 = nn.Conv2d(
          in_channels=in_channels,
          out_channels=32,
          kernel_size=3,
          stride=2,
          padding=1,
      )
      self.relu_1 = nn.ReLU(True)
      self.bn_1 = nn.BatchNorm2d(32)
  
      self.conv_2 = nn.Conv2d(
          in_channels=32,
          out_channels=64,
          kernel_size=3,
          stride=2,
          padding=1,
      )
      self.relu_2 = nn.ReLU(True)
      self.bn_2 = nn.BatchNorm2d(64)
  
      self.linear = nn.Linear(512, 512)
  
file_path: mmocr/mmocr/models/textrecog/backbones/nrtr_modality_transformer.py
imports: from typing import Dict, Optional, Sequence, Union
  import torch
  import torch.nn
  from mmengine.model import BaseModule
  from mmocr.registry import MODELS
label_desc: Use image node_id 1 to create a new NRTRModalityTransform object from inherited base classes: BaseModule with example: obj = NRTRModalityTransform(in_channels, init_cfg)