code: def assert_grad(
      self,
      transform: torch.nn.Module,
      inputs: List[torch.Tensor],
      *,
      nondet_tol: float = 0.0,
  ):
      transform = transform.to(dtype=torch.float64, device=self.device)
  
      # gradcheck and gradgradcheck only pass if the input tensors are of dtype `torch.double` or
      # `torch.cdouble`, when the default eps and tolerance values are used.
      inputs_ = []
      for i in inputs:
          if torch.is_tensor(i):
              i = i.to(
                  dtype=torch.cdouble
                  if i.is_complex()
                  else torch.double,
                  device=self.device,
              )
              i.requires_grad = True
          inputs_.append(i)
      assert gradcheck(transform, inputs_)
      assert gradgradcheck(transform, inputs_, nondet_tol=nondet_tol)
  
file_path: audio/test/torchaudio_unittest/prototype/transforms/autograd_test_impl.py
imports: from typing import List
  import torch
  import torchaudio.prototype.transforms
  from torch.autograd import gradcheck, gradgradcheck
  from torchaudio_unittest.common_utils import get_spectrogram, get_whitenoise, TestBaseMixin
label_desc: Use image node_id 1 for calling the Autograd obj's underlying member method code with example usage: obj.assert_grad(transform, inputs) without return types