code: def __init__(self, num_code: int, code_dimension: int):
      super().__init__()
      self.num_code = num_code
      self.code_dimension = code_dimension
      self.embedding = nn.Embedding(num_code, code_dimension)
      span = 1.0 / num_code
      self.embedding.weight.data.uniform_(-span, span)
  
imports: import torch
  from torch import nn
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import Optional
  from typing import NamedTuple
  from cftool.types import tensor_dict_type
  from .encoder import make_encoder
  from .encoder import IEncoder
  from .encoder import EncoderMixin
  from .decoder import make_decoder
  from .decoder import IDecoder
  from ...misc.toolkit import auto_num_layers
label_desc: Use image node_id 1 to create a new VQCodebook object from inherited base classes: nn with example: obj = VQCodebook(num_code, code_dimension)