class_docstr: Abstract base class for all attack classes.
class_docstr_tok: ["Abstract","base","class","for","all","attack","classes","."]
docstr: :param model: An instance of the cleverhans.model.Model class.
  :param sess: The (possibly optional) tf.Session to run graphs in.
  :param dtypestr: Floating point precision to use (change to float64
                   to avoid numerical instabilities).
  :param back: (deprecated and will be removed on or after 2019-03-26).
               The backend to use. Currently 'tf' is the only option.
docstr_tok: [":","param","model",":","An","instance","of","the","cleverhans.model.Model","class",".",":","param","sess",":","The","(","possibly","optional",")","tf.Session","to","run","graphs","in",".",":","param","dtypestr",":","Floating","point","precision","to","use","(","change","to","float64","to","avoid","numerical","instabilities",")",".",":","param","back",":","(","deprecated","and","will","be","removed","on","or","after","2019-03-26",")",".","The","backend","to","use",".","Currently","'tf","'","is","the","only","option","."]
code: def __init__(self, model, sess=None, dtypestr="float32", **kwargs):
      """
      :param model: An instance of the cleverhans.model.Model class.
      :param sess: The (possibly optional) tf.Session to run graphs in.
      :param dtypestr: Floating point precision to use (change to float64
                       to avoid numerical instabilities).
      :param back: (deprecated and will be removed on or after 2019-03-26).
                   The backend to use. Currently 'tf' is the only option.
      """
      if "back" in kwargs:
          if kwargs["back"] == "tf":
              warnings.warn(
                  "Argument back to attack constructors is not needed"
                  " anymore and will be removed on or after 2019-03-26."
                  " All attacks are implemented using TensorFlow."
              )
          else:
              raise ValueError(
                  "Backend argument must be 'tf' and is now deprecated"
                  "It will be removed on or after 2019-03-26."
              )
  
      self.tf_dtype = tf.as_dtype(dtypestr)
      self.np_dtype = np.dtype(dtypestr)
  
      if sess is not None and not isinstance(sess, tf.Session):
          raise TypeError("sess is not an instance of tf.Session")
  
      from cleverhans import attacks_tf
  
      attacks_tf.np_dtype = self.np_dtype
      attacks_tf.tf_dtype = self.tf_dtype
  
      if not isinstance(model, Model):
          raise TypeError(
              "The model argument should be an instance of"
              " the cleverhans.model.Model class."
          )
  
      # Prepare attributes
      self.model = model
      self.sess = sess
      self.dtypestr = dtypestr
  
      # We are going to keep track of old graphs and cache them.
      self.graphs = {}
  
      # When calling generate_np, arguments in the following set should be
      # fed into the graph, as they are not structural items that require
      # generating a new graph.
      # This dict should map names of arguments to the types they should
      # have.
      # (Usually, the target class will be a feedable keyword argument.)
      self.feedable_kwargs = tuple()
  
      # When calling generate_np, arguments in the following set should NOT
      # be fed into the graph, as they ARE structural items that require
      # generating a new graph.
      # This list should contain the names of the structural arguments.
      self.structural_kwargs = []
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/attack.py
imports: from abc import ABCMeta
  import collections
  import warnings
  import numpy
  import tensorflow
  from cleverhans.compat import reduce_max
  from cleverhans.model import Model
  from cleverhans import utils
label_desc: Use image node_id 1 to create a new Attack object from inherited base classes: object with example: obj = Attack(model, sess, dtypestr)