class_docstr: Test functions defined in `functional` module
class_docstr_tok: ["Test","functions","defined","in","`","functional","`","module"]
code: def test_detect_pitch_frequency(self, sample_rate, n_channels):
      # Use different frequencies to ensure each item in the batch returns a
      # different answer.
      frequencies = torch.randint(100, 1000, [self.batch_size])
      waveforms = torch.stack(
          [
              common_utils.get_sinusoid(
                  frequency=frequency,
                  sample_rate=sample_rate,
                  n_channels=n_channels,
                  duration=5,
              )
              for frequency in frequencies
          ]
      )
      kwargs = {
          "sample_rate": sample_rate,
      }
      func = partial(F.detect_pitch_frequency, **kwargs)
      self.assert_batch_consistency(func, inputs=(waveforms,))
  
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 3 for calling the TestFunctional obj's underlying member method code with example usage: obj.test_detect_pitch_frequency(sample_rate, n_channels) without return types