code: def __init__(
      self,
      img_size: int = 224,
      latent_dim: int = 512,
      *,
      # vision
      use_vision: bool = True,
      in_channels: int = 3,
      vision_latent_dim: int = 768,
      vision_patch_size: int = 32,
      vision_num_heads: int = 12,
      vision_num_layers: int = 12,
      vision_norm_eps: float = 1.0e-5,
      vision_feedforward_activation: str = "quick_gelu",
      # text
      use_text: bool = True,
      vocab_size: int = 49408,
      context_length: int = 77,
      use_text_triu_attn_mask: bool = True,
      token_type_size: Optional[int] = None,
      text_latent_dim: int = 512,
      text_padding_idx: int = 0,
      use_text_embedding_norm: bool = False,
      text_embedding_dropout: Optional[bool] = None,
      text_dropout: float = 0.0,
      text_num_heads: int = 8,
      text_num_layers: int = 12,
      text_norm_position: str = "pre_norm",
      text_norm_eps: float = 1.0e-5,
      text_feedforward_activation: str = "quick_gelu",
      text_head_pooler: Optional[str] = None,
  ):
      super().__init__(img_size, context_length)
      # vision
      if not use_vision:
          self.vit = None
      else:
          self._init_vision(
              img_size,
              latent_dim,
              in_channels,
              vision_latent_dim,
              vision_patch_size,
              vision_num_heads,
              vision_num_layers,
              vision_norm_eps,
              vision_feedforward_activation,
          )
      # text
      if not use_text:
          self.token_embedding = None
          self.token_type_embedding = None
          self.text_transformer = None
          self.text_latent_dropout = None
          self.text_projection = None
      else:
          self._init_text(
              latent_dim,
              vocab_size,
              context_length,
              use_text_triu_attn_mask,
              token_type_size,
              text_latent_dim,
              text_padding_idx,
              use_text_embedding_norm,
              text_embedding_dropout,
              text_dropout,
              text_num_heads,
              text_num_layers,
              text_norm_position,
              text_norm_eps,
              text_feedforward_activation,
              text_head_pooler,
          )
      # initialize
      self.reset_parameters()
  
imports: import torch
  from torch import nn
  from torch import Tensor
  from typing import Optional
  from cftool.cv import to_rgb
  from cftool.array import l2_normalize
  from torchvision.transforms import Resize
  from torchvision.transforms import Compose
  from torchvision.transforms import ToTensor
  from torchvision.transforms import Normalize
  from torchvision.transforms import CenterCrop
  from torchvision.transforms import InterpolationMode
  from .schema import IPerceptor
  from ...constants import INPUT_KEY
  from ...constants import LATENT_KEY
  from ...modules.blocks import HijackLinear
  from ..cv.encoder.transformer import ViTEncoder
  from ..nlp.encoder.transformer import TeTEncoder
label_desc: Use image node_id 1 to create a new CLIP object from inherited base classes: IPerceptor with example: obj = CLIP(img_size, latent_dim)