class_docstr: To run: "python -m saliency.tf1.integrated_gradients_test" from the top-level directory.
class_docstr_tok: ["To","run",":","``","python","-m","saliency.tf1.integrated_gradients_test","''","from","the","top-level","directory","."]
docstr: Tests that a single IG batch is created and aggregated correctly.
docstr_tok: ["Tests","that","a","single","IG","batch","is","created","and","aggregated","correctly","."]
code: def testIntegratedGradientsGetMaskSingleBatch(self):
      """Tests that a single IG batch is created and aggregated correctly."""
      x_steps = 999
      batch_size = 1000
      expected_calls = 1  # batch size is 1000, ceil(999/1000)=1
  
      mask = self.ig_instance.GetMask(
          x_value=self.x_input_val[0],
          feed_dict=None,
          x_baseline=self.x_baseline_val[0],
          x_steps=x_steps,
          batch_size=batch_size,
      )
  
      # Verify the result.
      np.testing.assert_almost_equal(mask, self.expected_val, decimal=2)
      self.assertEqual(self.sess_spy.run.call_count, expected_calls)
  
file_path: saliency/saliency/tf1/integrated_gradients_test.py
imports: import unittest
  import unittest.mock
  from .None import integrated_gradients
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the IntegratedGradientsTest obj's underlying member method code with example usage: obj.testIntegratedGradientsGetMaskSingleBatch() without return types