code: def resample(
      waveform: Tensor,
      orig_freq: int,
      new_freq: int,
      lowpass_filter_width: int = 6,
      rolloff: float = 0.99,
      resampling_method: str = "sinc_interp_hann",
      beta: Optional[float] = None,
  ) -> Tensor:
      r"""Resamples the waveform at the new frequency using bandlimited interpolation. :cite:`RESAMPLE`.
  
      .. devices:: CPU CUDA
  
      .. properties:: Autograd TorchScript
  
      Note:
          ``transforms.Resample`` precomputes and reuses the resampling kernel, so using it will result in
          more efficient computation if resampling multiple waveforms with the same resampling parameters.
  
      Args:
          waveform (Tensor): The input signal of dimension `(..., time)`
          orig_freq (int): The original frequency of the signal
          new_freq (int): The desired frequency
          lowpass_filter_width (int, optional): Controls the sharpness of the filter, more == sharper
              but less efficient. (Default: ``6``)
          rolloff (float, optional): The roll-off frequency of the filter, as a fraction of the Nyquist.
              Lower values reduce anti-aliasing, but also reduce some of the highest frequencies. (Default: ``0.99``)
          resampling_method (str, optional): The resampling method to use.
              Options: [``"sinc_interp_hann"``, ``"sinc_interp_kaiser"``] (Default: ``"sinc_interp_hann"``)
          beta (float or None, optional): The shape parameter used for kaiser window.
  
      Returns:
          Tensor: The waveform at the new frequency of dimension `(..., time).`
      """
  
      if orig_freq <= 0.0 or new_freq <= 0.0:
          raise ValueError(
              "Original frequency and desired frequecy should be positive"
          )
  
      if orig_freq == new_freq:
          return waveform
  
      gcd = math.gcd(int(orig_freq), int(new_freq))
  
      kernel, width = _get_sinc_resample_kernel(
          orig_freq,
          new_freq,
          gcd,
          lowpass_filter_width,
          rolloff,
          resampling_method,
          beta,
          waveform.device,
          waveform.dtype,
      )
      resampled = _apply_sinc_resample_kernel(
          waveform, orig_freq, new_freq, gcd, kernel, width
      )
      return resampled
  
imports: import math
  import tempfile
  import warnings
  from collections.abc import Sequence
  from typing import List, Optional, Tuple, Union
  import torch
  import torchaudio
  from torch import Tensor
  from torchaudio._internal.module_utils import deprecated
  from .filtering import highpass_biquad, treble_biquad
label_desc: Use image node_id 31 for calling a global function with example usage: resample(waveform, orig_freq, new_freq, lowpass_filter_width, rolloff, resampling_method, beta) and returns: resampled, waveform