code: def log_codes(self, codes):
      # This is so we can debug the distribution of codes being learned.
      if self.record_codes and self.internal_step % 10 == 0:
          codes = codes.flatten()
          l = codes.shape[0]
          i = (
              self.code_ind
              if (self.codes.shape[0] - self.code_ind) > l
              else self.codes.shape[0] - l
          )
          self.codes[i : i + l] = codes.cpu()
          self.code_ind = self.code_ind + l
          if self.code_ind >= self.codes.shape[0]:
              self.code_ind = 0
          self.total_codes += 1
      self.internal_step += 1
  
imports: import functools
  from math import sqrt
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from einops import rearrange
label_desc: Use image node_id 8 for calling the DiscreteVAE obj's underlying member method code with example usage: obj.log_codes(codes) without return types