class_docstr: To run: "python -m saliency.tf1.utils_test" from the top-level directory.
class_docstr_tok: ["To","run",":","``","python","-m","saliency.tf1.utils_test","''","from","the","top-level","directory","."]
docstr: Tests that call_model_function can't get conv values without conv_layer.
docstr_tok: ["Tests","that","call_model_function","ca","n't","get","conv","values","without","conv_layer","."]
code: def testConvolutionGradientsMissingConvLayer(self):
      """Tests that call_model_function can't get conv values without conv_layer."""
      with self.graph.as_default():
          x = tf.placeholder(shape=[None, 3], dtype=np.float32)
          conv_layer = -2 * x[:, 0] + 5 * x[:, 1] * x[:, 1]
          y = (conv_layer[:] * 2)[0]
      x_value = np.array([[0.5, 0.8, 1.0]], dtype=float)
      expected = (
          "Cannot return key CONVOLUTION_OUTPUT_GRADIENTS because no conv_layer "
          "was specified"
      )
  
      with self.assertRaisesRegex(RuntimeError, expected):
          call_model_function = utils.create_tf1_call_model_function(
              self.graph, self.sess, y=y, x=x
          )
          call_model_function(
              x_value,
              call_model_args=None,
              expected_keys=[utils.CONVOLUTION_OUTPUT_GRADIENTS],
          )
  
file_path: saliency/saliency/tf1/utils_test.py
imports: import unittest
  from .None import utils
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the UtilsTF1Test obj's underlying member method code with example usage: obj.testConvolutionGradientsMissingConvLayer() without return types