class_docstr: Implements test for Transforms that are performed for different devices
class_docstr_tok: ["Implements","test","for","Transforms","that","are","performed","for","different","devices"]
code: def test_speed_perturbation(self, use_lengths):
      leading_dims = (3, 2)
      time = 200
      waveform = torch.rand(
          *leading_dims,
          time,
          dtype=self.dtype,
          device=self.device,
          requires_grad=True,
      )
  
      if use_lengths:
          lengths = torch.randint(
              1,
              time,
              leading_dims,
              dtype=self.dtype,
              device=self.device,
          )
      else:
          lengths = None
  
      speed = T.SpeedPerturbation(1000, [0.9]).to(
          self.device, self.dtype
      )
      output = speed(waveform, lengths)
      ts_output = torch_script(speed)(waveform, lengths)
      self.assertEqual(ts_output, output)
  
imports: import torch
  import torchaudio.transforms
  from parameterized import parameterized
  from torchaudio_unittest import common_utils
  from torchaudio_unittest.common_utils import skipIfRocm, TestBaseMixin, torch_script
label_desc: Use image node_id 32 for calling the Transforms obj's underlying member method code with example usage: obj.test_speed_perturbation(use_lengths) without return types