class_docstr: Image to Patch Embedding.
class_docstr_tok: ["Image","to","Patch","Embedding","."]
docstr: Args:
      kernel_size: kernel size of the projection layer.
      stride: stride of the projection layer.
      padding: padding size of the projection layer.
      in_chans: Number of input image channels.
      embed_dim: Patch embedding dimension.
docstr_tok: ["Args",":","kernel_size",":","kernel","size","of","the","projection","layer",".","stride",":","stride","of","the","projection","layer",".","padding",":","padding","size","of","the","projection","layer",".","in_chans",":","Number","of","input","image","channels",".","embed_dim",":","Patch","embedding","dimension","."]
code: def __init__(
      self,
      kernel_size: tuple[int, int] = (16, 16),
      stride: tuple[int, int] = (16, 16),
      padding: tuple[int, int] = (0, 0),
      in_chans: int = 3,
      embed_dim: int = 768,
  ) -> None:
      """
      Args:
          kernel_size: kernel size of the projection layer.
          stride: stride of the projection layer.
          padding: padding size of the projection layer.
          in_chans: Number of input image channels.
          embed_dim: Patch embedding dimension.
      """
      super().__init__()
  
      self.proj = nn.Conv2d(
          in_chans,
          embed_dim,
          kernel_size=kernel_size,
          stride=stride,
          padding=padding,
      )
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.contrib.models.common import LayerNorm2d, window_partition, window_unpartition
  from kornia.contrib.models.sam.architecture.common import MLPBlock
  from kornia.core import Module, Tensor, zeros
label_desc: Use image node_id 1 to create a new PatchEmbed object from inherited base classes: Module with example: obj = PatchEmbed(kernel_size, stride, padding, in_chans, embed_dim)