docstr: Ensure that compute_loudness is the same output for np and tf.
docstr_tok: ["Ensure","that","compute_loudness","is","the","same","output","for","np","and","tf","."]
code: def test_compute_loudness_tf_np(self):
      """Ensure that compute_loudness is the same output for np and tf."""
      sample_rate = 16000
      audio_len_sec = 0.21
      audio_sin = gen_np_sinusoid(
          self.frequency, self.amp, sample_rate, audio_len_sec
      )
      loudness_tf = spectral_ops.compute_loudness(
          audio_sin,
          sample_rate,
          self.frame_rate,
          self.frame_size,
          use_tf=True,
      )
      loudness_np = spectral_ops.compute_loudness(
          audio_sin,
          sample_rate,
          self.frame_rate,
          self.frame_size,
          use_tf=False,
      )
      # Allow tolerance within 1dB
      self.assertAllClose(
          loudness_tf.numpy(), loudness_np, atol=1, rtol=1
      )
  
imports: from absl.testing import parameterized
  from ddsp import spectral_ops
  from ddsp.test_util import gen_np_sinusoid
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 6 for calling the ComputeFeaturesTest obj's underlying member method code with example usage: obj.test_compute_loudness_tf_np() without return types