class_docstr: To run: "python -m saliency.tf1.occlusion_test" top-level saliency directory.
class_docstr_tok: ["To","run",":","``","python","-m","saliency.tf1.occlusion_test","''","top-level","saliency","directory","."]
code: def setUp(self):
      super().setUp()
      self.max_sigma = 10
      with tf.Graph().as_default() as graph:
          self.x = tf.placeholder(shape=[None, 5, 5], dtype=tf.float32)
          # Define function to just multiply all values by 3
          y = self.x[:, 1, 1] * 3 + self.x[:, 3, 3] * 3
          self.sess = tf.Session(graph=graph)
          self.sess_spy = mock.MagicMock(wraps=self.sess)
          # All black except white at [1,1] and [3,3].
          self.x_input_val = np.array(
              [
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 1.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 1.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
              ],
              dtype=float,
          )
  
          # The computed Occlusion mask should bias the center, but the quadrants
          # with nonzero values should be greater than the other two (exact expected
          # values stored in ref_mask).
          self.expected_val = np.array(
              [
                  [3.0, 6.0, 6.0, 3.0, 0.0],
                  [6.0, 15.0, 18.0, 12.0, 3.0],
                  [6.0, 18.0, 24.0, 18.0, 6.0],
                  [3.0, 12.0, 18.0, 15.0, 6.0],
                  [0.0, 3.0, 6.0, 6.0, 3.0],
              ]
          )
          self.occlusion_instance = occlusion.Occlusion(
              graph, self.sess_spy, y, self.x
          )
  
file_path: saliency/saliency/tf1/occlusion_test.py
imports: import unittest
  import unittest.mock
  from .None import occlusion
  from .None import utils
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the OcclusionTest obj's underlying member method code with example usage: obj.setUp() without return types