class_docstr: Image to Patch Embedding
      
code: def __init__(
      self, img_size=224, patch_size=16, 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
      assert (
          img_size[0] % patch_size[0] == 0
          and img_size[1] % patch_size[1] == 0
      ), f"img_size {img_size} should be divided by 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=patch_size
      )
      self.norm = nn.LayerNorm(embed_dim)
  
imports: import math
  from functools import partial
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import Mlp, DropPath, to_2tuple, trunc_normal_, use_fused_attn
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_module
  from ._registry import register_model, generate_default_cfgs
  from .vision_transformer import Attention
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)