code: def _apply_sinc_resample_kernel(
      waveform: Tensor,
      orig_freq: int,
      new_freq: int,
      gcd: int,
      kernel: Tensor,
      width: int,
  ):
      if not waveform.is_floating_point():
          raise TypeError(
              f"Expected floating point type for waveform tensor, but received {waveform.dtype}."
          )
  
      orig_freq = int(orig_freq) // gcd
      new_freq = int(new_freq) // gcd
  
      # pack batch
      shape = waveform.size()
      waveform = waveform.view(-1, shape[-1])
  
      num_wavs, length = waveform.shape
      waveform = torch.nn.functional.pad(
          waveform, (width, width + orig_freq)
      )
      resampled = torch.nn.functional.conv1d(
          waveform[:, None], kernel, stride=orig_freq
      )
      resampled = resampled.transpose(1, 2).reshape(num_wavs, -1)
      target_length = torch.ceil(
          torch.as_tensor(new_freq * length / orig_freq)
      ).long()
      resampled = resampled[..., :target_length]
  
      # unpack batch
      resampled = resampled.view(shape[:-1] + resampled.shape[-1:])
      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 30 for calling a global function with example usage: _apply_sinc_resample_kernel(waveform, orig_freq, new_freq, gcd, kernel, width) and returns: resampled