class_docstr: Module for providing token embeddings from a pretrained model.
class_docstr_tok: ["Module","for","providing","token","embeddings","from","a","pretrained","model","."]
code: def __init__(
      self, embed_dim: int, downsample_dim: Optional[int] = None
  ) -> None:
      super().__init__(embed_dim)
      self.input_embed_dim = embed_dim
      if downsample_dim:
          self.proj = Linear(embed_dim, downsample_dim)
          self.embedding_dim = downsample_dim
      else:
          self.proj = PlaceholderIdentity()
  
file_path: pytext/pytext/models/embeddings/contextual_token_embedding.py
imports: from typing import Optional
  import torch
  from pytext.config.field_config import ContextualTokenEmbeddingConfig
  from pytext.models.seq_models.base import PlaceholderIdentity
  from torch.nn import Linear
  from .embedding_base import EmbeddingBase
label_desc: Use image node_id 2 to create a new ContextualTokenEmbedding object from inherited base classes: EmbeddingBase with example: obj = ContextualTokenEmbedding(embed_dim, downsample_dim)