class_docstr: checkpoint and kmeans can be downloaded at https://github.com/facebookresearch/fairseq/tree/main/examples/hubert
  or you can train your own
code: def forward(self, wav_input, flatten=True, input_sample_hz=None):
      device = wav_input.device
  
      if exists(input_sample_hz):
          wav_input = resample(
              wav_input, input_sample_hz, self.target_sample_hz
          )
  
      if exists(self.seq_len_multiple_of):
          wav_input = curtail_to_multiple(
              wav_input, self.seq_len_multiple_of
          )
  
      outputs = self.model.forward(
          wav_input,
          output_hidden_states=True,
      )
      embed = outputs["hidden_states"][self.output_layer]
      embed, packed_shape = pack([embed], "* d")
      codebook_indices = torch.from_numpy(
          embed.cpu().detach().numpy()
      ).to(device)
      if flatten:
          return codebook_indices
  
      (codebook_indices,) = unpack(codebook_indices, packed_shape, "*")
      return codebook_indices
  
file_path: TTS/TTS/tts/layers/bark/hubert/kmeans_hubert.py
imports: import logging
  from pathlib import Path
  import torch
  from einops import pack, unpack
  from torch import nn
  from torchaudio.functional import resample
  from transformers import HubertModel
label_desc: Use image node_id 3 for calling the CustomHubert obj's underlying member method code with example usage: obj.forward(wav_input, flatten, input_sample_hz) and returns: codebook_indices, codebook_indices