code: def __init__(
      self,
      patch_size=3,
      stride=2,
      padding=1,
      in_chans=3,
      embed_dim=768,
      norm_layer=nn.BatchNorm2D,
      light=False,
      asub=False,
      resolution=None,
      act_layer=nn.ReLU,
      attn_block=Attention4DDownsample,
  ):
      super().__init__()
      self.light = light
      self.asub = asub
  
      if self.light:
          self.new_proj = nn.Sequential(
              nn.Conv2D(
                  in_chans,
                  in_chans,
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  groups=in_chans,
              ),
              nn.BatchNorm2D(in_chans),
              nn.Hardswish(),
              nn.Conv2D(
                  in_chans,
                  embed_dim,
                  kernel_size=1,
                  stride=1,
                  padding=0,
              ),
              nn.BatchNorm2D(embed_dim),
          )
          self.skip = nn.Sequential(
              nn.Conv2D(
                  in_chans,
                  embed_dim,
                  kernel_size=1,
                  stride=2,
                  padding=0,
              ),
              nn.BatchNorm2D(embed_dim),
          )
      elif self.asub:
          self.attn = attn_block(
              dim=in_chans,
              out_dim=embed_dim,
              resolution=resolution,
              act_layer=act_layer,
          )
  
          patch_size = to_2tuple(patch_size)
          stride = to_2tuple(stride)
          padding = to_2tuple(padding)
          self.conv = nn.Conv2D(
              in_chans,
              embed_dim,
              kernel_size=patch_size,
              stride=stride,
              padding=padding,
          )
          self.bn = (
              norm_layer(embed_dim) if norm_layer else nn.Identity()
          )
      else:
          patch_size = to_2tuple(patch_size)
          stride = to_2tuple(stride)
          padding = to_2tuple(padding)
          self.proj = nn.Conv2D(
              in_chans,
              embed_dim,
              kernel_size=patch_size,
              stride=stride,
              padding=padding,
          )
          self.norm = (
              norm_layer(embed_dim) if norm_layer else nn.Identity()
          )
  
imports: import math
  import itertools
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.utils import utils
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.models.backbones.transformer_utils import *
label_desc: Use image node_id 1 to create a new Embedding object from inherited base classes: nn with example: obj = Embedding(patch_size, stride, padding, in_chans, embed_dim, norm_layer, light, asub, resolution, act_layer, attn_block)