class_docstr: Test class for utils_tf
class_docstr_tok: ["Test","class","for","utils_tf"]
docstr: test_zero_out_clipped_grads: Test that gradient gets zeroed out at positions
  where no progress can be made due to clipping.
docstr_tok: ["test_zero_out_clipped_grads",":","Test","that","gradient","gets","zeroed","out","at","positions","where","no","progress","can","be","made","due","to","clipping","."]
code: def test_zero_out_clipped_grads(self):
      """
      test_zero_out_clipped_grads: Test that gradient gets zeroed out at positions
      where no progress can be made due to clipping.
      """
  
      clip_min = -1
      clip_max = 1
      eta = tf.constant(
          [[0.0], [-1.0], [1], [0.5], [-1], [1], [-0.9], [0.9]]
      )
      grad = tf.constant(
          [[1.0], [-1.0], [1.0], [1.0], [1.0], [-1.0], [-1.0], [1.0]]
      )
  
      grad2 = self.sess.run(
          utils_tf.zero_out_clipped_grads(grad, eta, clip_min, clip_max)
      )
  
      expected = np.asarray(
          [[1.0], [0.0], [0.0], [1.0], [1.0], [-1.0], [-1.0], [1.0]]
      )
      self.assertClose(grad2, expected)
  
file_path: cleverhans/cleverhans_v3.1.0/tests_tf/test_utils_tf.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import tensorflow
  from cleverhans import utils_tf
  from cleverhans.devtools.checks import CleverHansTest
label_desc: Use image node_id 7 for calling the TestUtilsTF obj's underlying member method code with example usage: obj.test_zero_out_clipped_grads() without return types