class_docstr: Image to Patch Embedding
  Args:
      patch_size (int): Patch token size. Default: 4.
      in_chans (int): Number of input image channels. Default: 3.
      embed_dim (int): Number of linear projection output channels. Default: 96.
      norm_layer (nn.Layer, optional): Normalization layer. Default: None
      use_conv_embed (bool): Whether use overlapped convolution for patch embedding. Default: False
      is_stem (bool): Is the stem block or not. 
class_docstr_tok: ["Image","to","Patch","Embedding","Args",":","patch_size","(","int",")",":","Patch","token","size",".","Default",":","4.","in_chans","(","int",")",":","Number","of","input","image","channels",".","Default",":","3.","embed_dim","(","int",")",":","Number","of","linear","projection","output","channels",".","Default",":","96.","norm_layer","(","nn.Layer",",","optional",")",":","Normalization","layer",".","Default",":","None","use_conv_embed","(","bool",")",":","Whether","use","overlapped","convolution","for","patch","embedding",".","Default",":","False","is_stem","(","bool",")",":","Is","the","stem","block","or","not","."]
code: def __init__(
      self,
      patch_size=4,
      in_chans=3,
      embed_dim=96,
      norm_layer=None,
      use_conv_embed=False,
      is_stem=False,
  ):
      super().__init__()
      patch_size = to_2tuple(patch_size)
      self.patch_size = patch_size
  
      self.in_chans = in_chans
      self.embed_dim = embed_dim
  
      if use_conv_embed:
          # if we choose to use conv embedding, then we treat the stem and non-stem differently
          if is_stem:
              kernel_size = 7
              padding = 2
              stride = 4
          else:
              kernel_size = 3
              padding = 1
              stride = 2
          self.proj = nn.Conv2D(
              in_chans,
              embed_dim,
              kernel_size=kernel_size,
              stride=stride,
              padding=padding,
          )
      else:
          self.proj = nn.Conv2D(
              in_chans,
              embed_dim,
              kernel_size=patch_size,
              stride=patch_size,
          )
  
      if norm_layer is not None:
          self.norm = norm_layer(embed_dim)
      else:
          self.norm = None
  
imports: import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.modeling.shape_spec import ShapeSpec
  from ppdet.core.workspace import register, serializable
  from .transformer_utils import DropPath, Identity
  from .transformer_utils import add_parameter, to_2tuple
  from .transformer_utils import ones_, zeros_, trunc_normal_
  from .swin_transformer import Mlp
label_desc: Use image node_id 1 to create a new PatchEmbed object from inherited base classes: nn with example: obj = PatchEmbed(patch_size, in_chans, embed_dim, norm_layer, use_conv_embed, is_stem)