class_docstr: Construct the word embeddings given vocab size and embed dim.
  
  Args:
      d_model (int): The embedding dimension.
      vocab (int): Vocablury size.
class_docstr_tok: ["Construct","the","word","embeddings","given","vocab","size","and","embed","dim",".","Args",":","d_model","(","int",")",":","The","embedding","dimension",".","vocab","(","int",")",":","Vocablury","size","."]
code: def __init__(self, d_model: int, vocab: int):
      super().__init__()
      self.lut = nn.Embedding(vocab, d_model)
      self.d_model = d_model
  
imports: import copy
  import math
  from typing import Dict, Optional, Sequence, Union
  import torch
  import torch.nn
  from mmcv.cnn.bricks.transformer import BaseTransformerLayer
  from mmengine.model import ModuleList
  from mmocr.models.common.dictionary import Dictionary
  from mmocr.models.common.modules import PositionalEncoding
  from mmocr.registry import MODELS
  from mmocr.structures import TextRecogDataSample
  from .base import BaseDecoder
label_desc: Use image node_id 1 to create a new Embeddings object from inherited base classes: nn with example: obj = Embeddings(d_model, vocab)