class_docstr: Image to Patch Embedding
      
class_docstr_tok: ["Image","to","Patch","Embedding"]
code: def __init__(
      self,
      img_size=224,
      patch_size=7,
      stride=4,
      in_chans=3,
      embed_dim=768,
  ):
      super().__init__()
      img_size = to_2tuple(img_size)
      patch_size = to_2tuple(patch_size)
  
      self.img_size = img_size
      self.patch_size = patch_size
      self.H, self.W = (
          img_size[0] // patch_size[0],
          img_size[1] // patch_size[1],
      )
      self.num_patches = self.H * self.W
      self.proj = nn.Conv2D(
          in_chans,
          embed_dim,
          kernel_size=patch_size,
          stride=stride,
          padding=(patch_size[0] // 2, patch_size[1] // 2),
      )
      self.norm = nn.LayerNorm(embed_dim)
  
      self.apply(self._init_weights)
  
imports: import math
  from functools import partial
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import paddle.nn.initializer
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils
  from paddleseg.models.backbones.transformer_utils import *
label_desc: Use image node_id 1 to create a new OverlapPatchEmbed object from inherited base classes: nn with example: obj = OverlapPatchEmbed(img_size, patch_size, stride, in_chans, embed_dim)