class_docstr: Test class for utils_tf
class_docstr_tok: ["Test","class","for","utils_tf"]
docstr: test_clip_eta_norm_0: Test that `clip_eta` still works when the
  norm of `eta` is zero. This used to cause a divide by zero for ord
  1 and ord 2.
docstr_tok: ["test_clip_eta_norm_0",":","Test","that","`","clip_eta","`","still","works","when","the","norm","of","`","eta","`","is","zero",".","This","used","to","cause","a","divide","by","zero","for","ord","1","and","ord","2","."]
code: def test_clip_eta_norm_0(self):
      """test_clip_eta_norm_0: Test that `clip_eta` still works when the
      norm of `eta` is zero. This used to cause a divide by zero for ord
      1 and ord 2."""
      eta = tf.zeros((5, 3))
      self.assertTrue(eta.dtype == tf.float32, eta.dtype)
      eps = 0.25
      for ord_arg in [np.inf, 1, 2]:
          try:
              clipped = utils_tf.clip_eta(eta, ord_arg, eps)
          except NotImplementedError:
              # Don't raise SkipTest, it skips the rest of the for loop
              continue
          clipped = self.sess.run(clipped)
          self.assertTrue(not np.any(np.isinf(clipped)))
          self.assertTrue(
              not np.any(np.isnan(clipped)), (ord_arg, clipped)
          )
  
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 5 for calling the TestUtilsTF obj's underlying member method code with example usage: obj.test_clip_eta_norm_0() without return types