class_docstr: Image to Patch Embedding
      
class_docstr_tok: ["Image","to","Patch","Embedding"]
code: def __init__(
      self,
      img_size=224,
      patch_size=16,
      in_chans=3,
      embed_dim=768,
      multi_conv=False,
  ):
      super().__init__()
      img_size = to_2tuple(img_size)
      patch_size = to_2tuple(patch_size)
      num_patches = (img_size[1] // patch_size[1]) * (
          img_size[0] // patch_size[0]
      )
      self.img_size = img_size
      self.patch_size = patch_size
      self.num_patches = num_patches
      if multi_conv:
          if patch_size[0] == 12:
              self.proj = nn.Sequential(
                  nn.Conv2d(
                      in_chans,
                      embed_dim // 4,
                      kernel_size=7,
                      stride=4,
                      padding=3,
                  ),
                  nn.ReLU(inplace=True),
                  nn.Conv2d(
                      embed_dim // 4,
                      embed_dim // 2,
                      kernel_size=3,
                      stride=3,
                      padding=0,
                  ),
                  nn.ReLU(inplace=True),
                  nn.Conv2d(
                      embed_dim // 2,
                      embed_dim,
                      kernel_size=3,
                      stride=1,
                      padding=1,
                  ),
              )
          elif patch_size[0] == 16:
              self.proj = nn.Sequential(
                  nn.Conv2d(
                      in_chans,
                      embed_dim // 4,
                      kernel_size=7,
                      stride=4,
                      padding=3,
                  ),
                  nn.ReLU(inplace=True),
                  nn.Conv2d(
                      embed_dim // 4,
                      embed_dim // 2,
                      kernel_size=3,
                      stride=2,
                      padding=1,
                  ),
                  nn.ReLU(inplace=True),
                  nn.Conv2d(
                      embed_dim // 2,
                      embed_dim,
                      kernel_size=3,
                      stride=2,
                      padding=1,
                  ),
              )
      else:
          self.proj = nn.Conv2d(
              in_chans,
              embed_dim,
              kernel_size=patch_size,
              stride=patch_size,
          )
  
imports: from functools import partial
  from typing import List
  from typing import Tuple
  import torch
  import torch.hub
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import DropPath, to_2tuple, trunc_normal_, _assert
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_function
  from ._registry import register_model, generate_default_cfgs
  from .vision_transformer import Block
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, multi_conv)