code: def normalized_waveform_to_bits(
      waveform: torch.Tensor, bits: int
  ) -> torch.Tensor:
      r"""Transform waveform [-1, 1] to label [0, 2 ** bits - 1]"""
  
      assert abs(waveform).max() <= 1.0
      waveform = (waveform + 1.0) * (2**bits - 1) / 2
      return torch.clamp(waveform, 0, 2**bits - 1).int()
  
file_path: audio/examples/pipeline_wavernn/processing.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 for calling a global function with example usage: normalized_waveform_to_bits(waveform, bits) and returns: torch