class_docstr: To run: "python -m saliency.core.grad_cam_test" from top-level saliency directory.
class_docstr_tok: ["To","run",":","``","python","-m","saliency.core.grad_cam_test","''","from","top-level","saliency","directory","."]
code: def testGradCamCallModelArgs(self):
      img = np.ones([INPUT_HEIGHT_WIDTH, INPUT_HEIGHT_WIDTH])
      img = img.reshape([INPUT_HEIGHT_WIDTH, INPUT_HEIGHT_WIDTH, 1])
      expected_keys = [
          CONVOLUTION_LAYER_VALUES,
          CONVOLUTION_OUTPUT_GRADIENTS,
      ]
      call_model_args = {"foo": "bar"}
      mock_call_model = mock.MagicMock(
          return_value={
              CONVOLUTION_LAYER_VALUES: [img],
              CONVOLUTION_OUTPUT_GRADIENTS: [img],
          }
      )
  
      self.grad_cam_instance.GetMask(
          img,
          call_model_function=mock_call_model,
          call_model_args=call_model_args,
          should_resize=True,
          three_dims=False,
      )
      calls = mock_call_model.mock_calls
  
      self.assertEqual(len(calls), 1)
      for call in calls:
          kwargs = call[2]
          self.assertEqual(
              kwargs["call_model_args"],
              call_model_args,
              msg="function was called with incorrect call_model_args.",
          )
          self.assertEqual(
              kwargs["expected_keys"],
              expected_keys,
              msg="function was called with incorrect expected_keys.",
          )
  
file_path: saliency/saliency/core/grad_cam_test.py
imports: import unittest
  import unittest.mock
  from .base import SHAPE_ERROR_MESSAGE
  from .None import grad_cam
  import numpy
label_desc: Use image node_id 3 for calling the GradCamTest obj's underlying member method code with example usage: obj.testGradCamCallModelArgs() without return types