class_docstr: To run: "python -m saliency.tf1.igradients_test" from the top-level directory.
docstr: Tests that gradients are fetched and returned correctly.
docstr_tok: ["Tests","that","gradients","are","fetched","and","returned","correctly","."]
code: def testGradientsGetMask(self):
      """Tests that gradients are fetched and returned correctly."""
      # f(x,y,z) = 5x + y^2, sin(z)
      # d(f(x,y,z)) = [5, 2y, cos(z)]
      expected_val = np.array([5, 2 * 2, np.cos(3)])
  
      mask = self.grad_instance.GetMask(
          x_value=self.x_input_val, feed_dict=None
      )
  
      # Verify the result.
      np.testing.assert_almost_equal(mask, expected_val, decimal=2)
      self.assertEqual(self.sess_spy.run.call_count, 1)
  
file_path: saliency/saliency/tf1/gradients_test.py
imports: import unittest
  import unittest.mock
  from .None import gradients
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the GradientsTest obj's underlying member method code with example usage: obj.testGradientsGetMask() without return types