class_docstr: Identical to the TestOptimizeLinear in tests_tf/test_attacks.
class_docstr_tok: ["Identical","to","the","TestOptimizeLinear","in","tests_tf\/test_attacks","."]
code: def test_optimize_linear_l2(self):
      grad = torch.tensor([[0.5**0.5, -(0.5**0.5)]])
      eta = utils.optimize_linear(grad, eps=1.0, norm=2)
      objective = torch.sum(grad * eta)
  
      self.assertEqual(grad.size(), eta.size())
      self.assertClose(objective, 1.0)
      self.assertClose(eta.pow(2).sum().sqrt(), 1.0)
  
file_path: cleverhans/cleverhans/torch/tests/test_utils.py
imports: import numpy
  import torch
  import cleverhans.torch.utils
  from cleverhans.devtools.checks import CleverHansTest
label_desc: Use image node_id 3 for calling the TestOptimizeLinear obj's underlying member method code with example usage: obj.test_optimize_linear_l2() without return types