code: def _clip_wav(
      wav: torch.Tensor,
      log_clipping: bool = False,
      stem_name: tp.Optional[str] = None,
  ) -> None:
      """Utility function to clip the audio with logging if specified."""
      max_scale = wav.abs().max()
      if log_clipping and max_scale > 1:
          clamp_prob = (wav.abs() > 1).float().mean().item()
          print(
              f"CLIPPING {stem_name or ''} happening with proba (a bit of clipping is okay):",
              clamp_prob,
              "maximum scale: ",
              max_scale.item(),
              file=sys.stderr,
          )
      wav.clamp_(-1, 1)
  
file_path: audiocraft/audiocraft/data/audio_utils.py
imports: import sys
  import typing
  import julius
  import torch
  import torchaudio
label_desc: Use image node_id 4 for calling a global function with example usage: _clip_wav(wav, log_clipping, stem_name) without return types