class_docstr: Image to Patch Embedding using multiple convolutional layers
class_docstr_tok: ["Image","to","Patch","Embedding","using","multiple","convolutional","layers"]
code: def __init__(self, img_size=224, patch_size=16, embed_dim=768):
      super().__init__()
      img_size = to_2tuple(img_size)
      patch_size = to_2tuple(patch_size)
      self.feat_map_size = (
          img_size[0] // patch_size[0],
          img_size[1] // patch_size[1],
      )
      num_patches = self.feat_map_size[0] * self.feat_map_size[1]
      self.img_size = img_size
      self.patch_size = patch_size
      self.num_patches = num_patches
  
      if patch_size[0] == 16:
          self.proj = torch.nn.Sequential(
              conv3x3(3, embed_dim // 8, 2),
              nn.GELU(),
              conv3x3(embed_dim // 8, embed_dim // 4, 2),
              nn.GELU(),
              conv3x3(embed_dim // 4, embed_dim // 2, 2),
              nn.GELU(),
              conv3x3(embed_dim // 2, embed_dim, 2),
          )
      elif patch_size[0] == 8:
          self.proj = torch.nn.Sequential(
              conv3x3(3, embed_dim // 4, 2),
              nn.GELU(),
              conv3x3(embed_dim // 4, embed_dim // 2, 2),
              nn.GELU(),
              conv3x3(embed_dim // 2, embed_dim, 2),
          )
  
imports: import logging
  import math
  from functools import partial
  from typing import List, Optional
  import torch
  import torch.nn
  from fairscale.nn import checkpoint_wrapper
  from vissl.config import AttrDict
  from vissl.models.model_helpers import DropPath, to_2tuple, trunc_normal_
  from vissl.models.trunks import register_model_trunk
  from vissl.models.trunks.vision_transformer import Mlp
  from vissl.utils.fsdp_utils import fsdp_wrapper
  from vissl.utils.misc import set_torch_seed
label_desc: Use image node_id 1 to create a new ConvPatchEmbed object from inherited base classes: nn with example: obj = ConvPatchEmbed(img_size, patch_size, embed_dim)