class_docstr: To run: "python -m saliency.core.gradients_test" from the top-level directory.
docstr: Tests that GradientSaliency returns the output gradients.
docstr_tok: ["Tests","that","GradientSaliency","returns","the","output","gradients","."]
code: def testGradientsGetMask(self):
      """Tests that GradientSaliency returns the output gradients."""
      call_model_function = self.create_call_model_function()
      grad_instance = gradients.GradientSaliency()
      x_input = [3, 2, 1]
      self.expected_val = self.gradient_fn(x_input)
  
      mask = grad_instance.GetMask(
          x_value=x_input,
          call_model_function=call_model_function,
          call_model_args=None,
      )
  
      # Verify the result.
      np.testing.assert_almost_equal(mask, self.expected_val, decimal=2)
      self.assertEqual(call_model_function.num_calls, 1)
  
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 4 for calling the GradientSaliencyTest obj's underlying member method code with example usage: obj.testGradientsGetMask() without return types