class_docstr: Introduced in SoundStream: An end2end neural audio codec
  https://arxiv.org/abs/2107.03312
  
  
  Example
  -------
  Using a pretrained RVQ unit.
  
  >>> dac = DAC(load_pretrained=True, model_type="44KHz", model_bitrate="8kbps", tag="latest")
  >>> quantizer = dac.quantizer
  >>> continuous_embeddings = torch.randn(1, 1024, 100) # Example shape: [Batch, Channels, Time]
  >>> discrete_embeddings, codes, _, _, _ = quantizer(continuous_embeddings)
class_docstr_tok: ["Introduced","in","SoundStream",":","An","end2end","neural","audio","codec","https",":","\/\/arxiv.org\/abs\/2107.03312","Example","--","--","--","-","Using","a","pretrained","RVQ","unit",".",">",">",">","dac","=","DAC","(","load_pretrained=True",",","model_type=","''","44KHz","''",",","model_bitrate=","''","8kbps","''",",","tag=","''","latest","''",")",">",">",">","quantizer","=","dac.quantizer",">",">",">","continuous_embeddings","=","torch.randn","(","1",",","1024",",","100",")","#","Example","shape",":","[","Batch",",","Channels",",","Time","]",">",">",">","discrete_embeddings",",","codes",",","_",",","_",",","_","=","quantizer","(","continuous_embeddings",")"]
docstr: Initializes the ResidualVectorQuantize
  
  Parameters
  ----------
  input_dim : int, optional, by default 512
  n_codebooks : int, optional, by default 9
  codebook_size : int, optional, by default 1024
  codebook_dim : Union[int, list], optional,  by default 8
  quantizer_dropout : float, optional, by default 0.0
docstr_tok: ["Initializes","the","ResidualVectorQuantize","Parameters","--","--","--","--","--","input_dim",":","int",",","optional",",","by","default","512","n_codebooks",":","int",",","optional",",","by","default","9","codebook_size",":","int",",","optional",",","by","default","1024","codebook_dim",":","Union","[","int",",","list","]",",","optional",",","by","default","8","quantizer_dropout",":","float",",","optional",",","by","default","0.0"]
code: def __init__(
      self,
      input_dim: int = 512,
      n_codebooks: int = 9,
      codebook_size: int = 1024,
      codebook_dim: Union[int, list] = 8,
      quantizer_dropout: float = 0.0,
  ):
      """
      Initializes the ResidualVectorQuantize
  
      Parameters
      ----------
      input_dim : int, optional, by default 512
      n_codebooks : int, optional, by default 9
      codebook_size : int, optional, by default 1024
      codebook_dim : Union[int, list], optional,  by default 8
      quantizer_dropout : float, optional, by default 0.0
      """
      super().__init__()
      if isinstance(codebook_dim, int):
          codebook_dim = [codebook_dim for _ in range(n_codebooks)]
  
      self.n_codebooks = n_codebooks
      self.codebook_dim = codebook_dim
      self.codebook_size = codebook_size
  
      self.quantizers = nn.ModuleList(
          [
              VectorQuantize(input_dim, codebook_size, codebook_dim[i])
              for i in range(n_codebooks)
          ]
      )
      self.quantizer_dropout = quantizer_dropout
  
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 1 to create a new ResidualVectorQuantize object from inherited base classes: nn with example: obj = ResidualVectorQuantize(input_dim, n_codebooks, codebook_size, codebook_dim, quantizer_dropout)