code: def __init__(
      self,
      cfg: TokenizersConfig,
  ) -> None:
      super().__init__()
      logger.info(f"Tokenizers Config: {cfg.__dict__}")
  
      self.cfg = cfg
  
      self.embed = cfg.embed_dim
      self.post_extract_proj = (
          nn.Linear(self.embed, cfg.encoder_embed_dim)
          if self.embed != cfg.encoder_embed_dim
          else None
      )
  
      self.input_patch_size = cfg.input_patch_size
      self.patch_embedding = nn.Conv2d(
          1,
          self.embed,
          kernel_size=self.input_patch_size,
          stride=self.input_patch_size,
          bias=cfg.conv_bias,
      )
  
      self.dropout_input = nn.Dropout(cfg.dropout_input)
  
      assert not cfg.deep_norm or not cfg.layer_norm_first
      self.encoder = TransformerEncoder(cfg)
      self.layer_norm = LayerNorm(self.embed)
  
      self.quantize = NormEMAVectorQuantizer(
          n_embed=cfg.quant_n,
          embedding_dim=cfg.quant_dim,
          beta=1.0,
          kmeans_init=True,
          decay=0.99,
      )
      self.quant_n = cfg.quant_n
      self.quantize_layer = nn.Sequential(
          nn.Linear(cfg.encoder_embed_dim, cfg.encoder_embed_dim),
          nn.Tanh(),
          nn.Linear(
              cfg.encoder_embed_dim, cfg.quant_dim
          ),  # for quantize
      )
  
file_path: lavis/lavis/models/beats/Tokenizers.py
imports: import torch
  import torch.nn
  from torch.nn import LayerNorm
  import torchaudio.compliance.kaldi
  from lavis.models.beats.backbone import TransformerEncoder
  from lavis.models.beats.quantizer import NormEMAVectorQuantizer
  import logging
  from typing import Optional
label_desc: Use image node_id 1 to create a new Tokenizers object from inherited base classes: nn with example: obj = Tokenizers(cfg)