code: def gain(waveform: Tensor, gain_db: float = 1.0) -> Tensor:
      r"""Apply amplification or attenuation to the whole waveform.
  
      .. devices:: CPU CUDA
  
      .. properties:: Autograd TorchScript
  
      Args:
         waveform (Tensor): Tensor of audio of dimension (..., time).
         gain_db (float, optional) Gain adjustment in decibels (dB) (Default: ``1.0``).
  
      Returns:
         Tensor: the whole waveform amplified by gain_db.
      """
      if gain_db == 0:
          return waveform
  
      ratio = 10 ** (gain_db / 20)
  
      return waveform * ratio
  
imports: import math
  import warnings
  from typing import Optional
  import torch
  from torch import Tensor
  from torchaudio._extension import _IS_TORCHAUDIO_EXT_AVAILABLE
label_desc: Use image node_id 18 for calling a global function with example usage: gain(waveform, gain_db) and returns: unknown, waveform