class_docstr: Test class for utils_tf
class_docstr_tok: ["Test","class","for","utils_tf"]
docstr: test_random_lp_sample_linf: Test that `random_lp_vector` returns
  random samples in the l-inf ball.
docstr_tok: ["test_random_lp_sample_linf",":","Test","that","`","random_lp_vector","`","returns","random","samples","in","the","l-inf","ball","."]
code: def test_random_lp_vector_linf(self):
      """
      test_random_lp_sample_linf: Test that `random_lp_vector` returns
      random samples in the l-inf ball.
      """
  
      eps = 0.5
      d = 10
  
      r = self.sess.run(
          utils_tf.random_lp_vector((1000, d), np.infty, eps)
      )
  
      # test that some values are close to the boundaries
      self.assertLessEqual(np.max(r), eps)
      self.assertGreaterEqual(np.max(r), 0.95 * eps)
      self.assertGreaterEqual(np.min(r), -eps)
      self.assertLessEqual(np.min(r), -0.95 * eps)
  
      # test that the mean value of each feature is close to zero
      means = np.mean(r, axis=0)
      self.assertClose(means, np.zeros(d), atol=0.05)
  
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 8 for calling the TestUtilsTF obj's underlying member method code with example usage: obj.test_random_lp_vector_linf() without return types