class_docstr: Uses Adam to minimize the CW L2 objective function
  
  Paper link: https://arxiv.org/abs/1608.04644
class_docstr_tok: ["Uses","Adam","to","minimize","the","CW","L2","objective","function","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1608.04644"]
docstr: format img form (clip_min, clip_max) to (0, 1)
docstr_tok: ["format","img","form","(","clip_min",",","clip_max",")","to","(","0",",","1",")"]
code: def _process_input(self, input_):
      """
      format img form (clip_min, clip_max) to (0, 1)
      """
      res = None
      sub = self.pa_clip_min
      div = self.pa_clip_max - self.pa_clip_min
  
      if np.any(sub != 0):
          res = input_ - sub
      if not np.all(sub == 1):
          if res is None:  # "res = input_ - sub" is not executed!
              res = input_ / (div)
          else:
              res /= div
      if res is None:  # "res = (input_ - sub)/ div" is not executed!
          return input_
  
      res = np.where(res == 0, 0.00001, res)
      res = np.where(res == 1, 0.99999, res)  # no 0 or 1
  
      return res
  
file_path: AdvBox/adversarialbox/attacks/cw.py
imports: from __future__ import division
  from __future__ import print_function
  from builtins import range
  import logging
  import numpy
  import paddle.fluid
  from .base import Attack
label_desc: Use image node_id 7 for calling the CW_L2_Attack obj's underlying member method code with example usage: obj._process_input(input_) and returns: res, input_