class_docstr: Test the ImperceptibleASR attack.
class_docstr_tok: ["Test","the","ImperceptibleASR","attack","."]
code: def test_loss_gradient_masking_threshold(
      self, art_warning, asr_dummy_estimator, audio_data
  ):
      try:
          test_input, _ = audio_data
          test_delta = test_input * 0
  
          imperceptible_asr = ImperceptibleASR(
              estimator=asr_dummy_estimator(),
              masker=PsychoacousticMasker(),
          )
  
          (
              masking_threshold,
              psd_maximum,
          ) = imperceptible_asr._stabilized_threshold_and_psd_maximum(
              test_input
          )
          (
              loss_gradient,
              loss,
          ) = imperceptible_asr._loss_gradient_masking_threshold(
              test_delta, test_input, masking_threshold, psd_maximum
          )
  
          assert [g.shape for g in loss_gradient] == [
              d.shape for d in test_delta
          ]
          assert loss.ndim == 1 and loss.shape == test_delta.shape
      except ARTTestException as e:
          art_warning(e)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import numpy
  import pytest
  from art.attacks.attack import EvasionAttack
  from art.attacks.evasion.imperceptible_asr.imperceptible_asr import ImperceptibleASR, PsychoacousticMasker
  from tests.utils import ARTTestException
label_desc: Use image node_id 7 for calling the TestImperceptibleASR obj's underlying member method code with example usage: obj.test_loss_gradient_masking_threshold(art_warning, asr_dummy_estimator, audio_data) without return types