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_TimeStretch(self):
      n_fft = 1025
      n_freq = n_fft // 2 + 1
      hop_length = 512
      fixed_rate = 1.3
      tensor = torch.rand((10, 2, n_freq, 10), dtype=torch.cfloat)
      batch = 10
      num_channels = 2
  
      waveform = common_utils.get_whitenoise(
          sample_rate=8000, n_channels=batch * num_channels
      )
      tensor = common_utils.get_spectrogram(waveform, n_fft=n_fft)
      tensor = tensor.reshape(batch, num_channels, n_freq, -1)
      self._assert_consistency_complex(
          T.TimeStretch(
              n_freq=n_freq,
              hop_length=hop_length,
              fixed_rate=fixed_rate,
          ),
          tensor,
      )
  
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 23 for calling the Transforms obj's underlying member method code with example usage: obj.test_TimeStretch() without return types