class_docstr: Image to the progressive overlapping Patch Embedding.
  
  Args:
      in_channels (int): Number of input channels. Defaults to 3.
      embed_dims (int): The dimensions of embedding. Defaults to 768.
      num_layers (int, optional): Number of Conv_BN_Layer. Defaults to 2 and
          limit to [2, 3].
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
class_docstr_tok: ["Image","to","the","progressive","overlapping","Patch","Embedding",".","Args",":","in_channels","(","int",")",":","Number","of","input","channels",".","Defaults","to","3.","embed_dims","(","int",")",":","The","dimensions","of","embedding",".","Defaults","to","768.","num_layers","(","int",",","optional",")",":","Number","of","Conv_BN_Layer",".","Defaults","to","2","and","limit","to","[","2",",","3","]",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","configs",".","Defaults","to","None","."]
code: def __init__(
      self,
      in_channels: int = 3,
      embed_dims: int = 768,
      num_layers: int = 2,
      init_cfg: Optional[Union[Dict, List[Dict]]] = None,
  ):
      super().__init__(init_cfg=init_cfg)
  
      assert num_layers in [
          2,
          3,
      ], "The number of layers must belong to [2, 3]"
      self.net = nn.Sequential()
      for num in range(num_layers, 0, -1):
          if num == num_layers:
              _input = in_channels
          _output = embed_dims // (2 ** (num - 1))
          self.net.add_module(
              f"ConvModule{str(num_layers - num)}",
              ConvModule(
                  in_channels=_input,
                  out_channels=_output,
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  norm_cfg=dict(type="BN"),
                  act_cfg=dict(type="GELU"),
              ),
          )
          _input = _output
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmcv.cnn.bricks import DropPath
  from mmengine.model import BaseModule
  from mmengine.model.weight_init import trunc_normal_init
  from mmocr.registry import MODELS
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 1 to create a new OverlapPatchEmbed object from inherited base classes: BaseModule with example: obj = OverlapPatchEmbed(in_channels, embed_dims, num_layers, init_cfg)