code: def __init__(self, codebook_size, emb_dim, beta):
      super(VectorQuantizer, self).__init__()
      self.codebook_size = codebook_size  # number of embeddings
      self.emb_dim = emb_dim  # dimension of embedding
      self.beta = beta  # commitment cost used in loss term, beta * ||z_e(x)-sg[e]||^2
      self.embedding = nn.Embedding(self.codebook_size, self.emb_dim)
      self.embedding.weight.data.uniform_(
          -1.0 / self.codebook_size, 1.0 / self.codebook_size
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from basicsr.utils import get_root_logger
  from basicsr.utils.registry import ARCH_REGISTRY
label_desc: Use image node_id 1 to create a new VectorQuantizer object from inherited base classes: nn with example: obj = VectorQuantizer(codebook_size, emb_dim, beta)