class_docstr: An implementation for Vector Quantization
class_docstr_tok: ["An","implementation","for","Vector","Quantization"]
docstr: Embeds an ID using the codebook weights.
  
  This method utilizes the codebook weights to embed the given ID.
  
  Parameters
  ----------
  embed_id : torch.Tensor
      The tensor containing IDs that need to be embedded.
  
  Returns
  -------
  torch.Tensor
      The embedded output tensor after applying the codebook weights.
docstr_tok: ["Embeds","an","ID","using","the","codebook","weights",".","This","method","utilizes","the","codebook","weights","to","embed","the","given","ID",".","Parameters","--","--","--","--","--","embed_id",":","torch.Tensor","The","tensor","containing","IDs","that","need","to","be","embedded",".","Returns","--","--","--","-","torch.Tensor","The","embedded","output","tensor","after","applying","the","codebook","weights","."]
code: def embed_code(self, embed_id: torch.Tensor):
      """
      Embeds an ID using the codebook weights.
  
      This method utilizes the codebook weights to embed the given ID.
  
      Parameters
      ----------
      embed_id : torch.Tensor
          The tensor containing IDs that need to be embedded.
  
      Returns
      -------
      torch.Tensor
          The embedded output tensor after applying the codebook weights.
      """
      return F.embedding(embed_id, self.codebook.weight)
  
imports: import math
  from pathlib import Path
  from typing import List, Union
  import logging
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.utils.parametrizations import weight_norm
label_desc: Use image node_id 3 for calling the VectorQuantize obj's underlying member method code with example usage: obj.embed_code(embed_id) and returns: F