class_docstr: Test functions defined in `functional` module
class_docstr_tok: ["Test","functions","defined","in","`","functional","`","module"]
code: def test_add_noise(self):
      leading_dims = (5, 2, 3)
      L = 51
  
      waveform = torch.rand(
          *leading_dims, L, dtype=self.dtype, device=self.device
      )
      noise = torch.rand(
          *leading_dims, L, dtype=self.dtype, device=self.device
      )
      lengths = torch.rand(
          *leading_dims, dtype=self.dtype, device=self.device
      )
      snr = (
          torch.rand(
              *leading_dims, dtype=self.dtype, device=self.device
          )
          * 10
      )
  
      actual = F.add_noise(waveform, noise, snr, lengths)
  
      expected = []
      for i in range(leading_dims[0]):
          for j in range(leading_dims[1]):
              for k in range(leading_dims[2]):
                  expected.append(
                      F.add_noise(
                          waveform[i][j][k],
                          noise[i][j][k],
                          snr[i][j][k],
                          lengths[i][j][k],
                      )
                  )
  
      self.assertEqual(torch.stack(expected), actual.reshape(-1, L))
  
imports: import itertools
  import math
  from functools import partial
  import torch
  import torchaudio.functional
  from parameterized import parameterized, parameterized_class
  from torchaudio_unittest import common_utils
label_desc: Use image node_id 27 for calling the TestFunctional obj's underlying member method code with example usage: obj.test_add_noise() without return types