class_docstr: To run: "python -m saliency.core.gradients_test" from the top-level directory.
docstr: Tests that GradientSaliency errors when receiving incorrect model output.
docstr_tok: ["Tests","that","GradientSaliency","errors","when","receiving","incorrect","model","output","."]
code: def testGradientsGetMaskError(self):
      """Tests that GradientSaliency errors when receiving incorrect model output."""
      call_model_function = self.create_bad_call_model_function()
      expected_error = SHAPE_ERROR_MESSAGE[
          INPUT_OUTPUT_GRADIENTS
      ].format("\\(1, 3\\)", "\\(3,\\)")
      grad_instance = gradients.GradientSaliency()
      x_input = [3, 2, 1]
  
      with self.assertRaisesRegex(ValueError, expected_error):
          grad_instance.GetMask(
              x_value=x_input,
              call_model_function=call_model_function,
              call_model_args=None,
          )
  
file_path: saliency/saliency/core/gradients_test.py
imports: import unittest
  import unittest.mock
  from .base import INPUT_OUTPUT_GRADIENTS
  from .base import SHAPE_ERROR_MESSAGE
  from .None import gradients
  import numpy
label_desc: Use image node_id 6 for calling the GradientSaliencyTest obj's underlying member method code with example usage: obj.testGradientsGetMaskError() without return types