class_docstr: Quantizes incoming data in a differentiable way.
class_docstr_tok: ["Quantizes","incoming","data","in","a","differentiable","way","."]
docstr: :param input_dim:
      The dimensionality of inputs.
  :param output_dim:
      The dimensionality of quantized outputs.
docstr_tok: [":","param","input_dim",":","The","dimensionality","of","inputs",".",":","param","output_dim",":","The","dimensionality","of","quantized","outputs","."]
code: def __init__(self, input_dim: int, output_dim: int) -> None:
      """
      :param input_dim:
          The dimensionality of inputs.
      :param output_dim:
          The dimensionality of quantized outputs.
      """
      super().__init__()
  
      self.input_dim = input_dim
      self.output_dim = output_dim
  
imports: from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Optional, Tuple, final
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import Module, Parameter
  from torch.nn.functional import gumbel_softmax
  from fairseq2.nn.projection import Linear
  from fairseq2.typing import DataType, Device, finaloverride
label_desc: Use image node_id 1 to create a new VectorQuantizer object from inherited base classes: Module, ABC with example: obj = VectorQuantizer(input_dim, output_dim)