class_docstr: 2D Image to Patch Embedding.
code: def __init__(
      self,
      img_size=224,
      patch_size=16,
      in_chans=3,
      embed_dim=768,
      norm_layer=None,
      flatten=True,
  ):
      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.grid_size = (
          img_size[0] // patch_size[0],
          img_size[1] // patch_size[1],
      )
      self.num_patches = self.grid_size[0] * self.grid_size[1]
      self.flatten = flatten
  
      self.proj = nn.Conv2D(
          in_chans, embed_dim, kernel_size=patch_size, stride=patch_size
      )
      self.norm = norm_layer(embed_dim) if norm_layer else nn.Identity()
  
imports: import math
  from functools import partial
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils, logger
  from paddleseg.cvlibs.param_init import normal_init, trunc_normal_init, constant_init
  from paddleseg.models.backbones.transformer_utils import to_2tuple, DropPath
  from paddleseg.models.layers.vit_adapter_layers import SpatialPriorModule, InteractionBlock, deform_inputs
  from paddleseg.models.layers.ms_deformable_attention import MSDeformAttn
label_desc: Use image node_id 1 to create a new PatchEmbed object from inherited base classes: nn with example: obj = PatchEmbed(img_size, patch_size, in_chans, embed_dim, norm_layer, flatten)