class_docstr: Wrapper class for adversarial attacks on models. Given any normal
  model (a ``ch.nn.Module`` instance), wrapping it in AttackerModel allows
  for convenient access to adversarial attacks and other applications.::
  
      model = ResNet50()
      model = AttackerModel(model)
      x = ch.rand(10, 3, 32, 32) # random images
      y = ch.zeros(10) # label 0
      out, new_im = model(x, y, make_adv=True) # adversarial attack
      out, new_im = model(x, y, make_adv=True, targeted=True) # targeted attack
      out = model(x) # normal inference (no label needed)
  
  More code examples available in the documentation for `forward`.
  For a more comprehensive overview of this class, see 
  :doc:`our detailed walkthrough <../example_usage/input_space_manipulation>`.
class_docstr_tok: ["Wrapper","class","for","adversarial","attacks","on","models",".","Given","any","normal","model","(","a","``","ch.nn.Module","``","instance",")",",","wrapping","it","in","AttackerModel","allows","for","convenient","access","to","adversarial","attacks","and","other","applications",".",":",":","model","=","ResNet50","(",")","model","=","AttackerModel","(","model",")","x","=","ch.rand","(","10",",","3",",","32",",","32",")","#","random","images","y","=","ch.zeros","(","10",")","#","label","0","out",",","new_im","=","model","(","x",",","y",",","make_adv=True",")","#","adversarial","attack","out",",","new_im","=","model","(","x",",","y",",","make_adv=True",",","targeted=True",")","#","targeted","attack","out","=","model","(","x",")","#","normal","inference","(","no","label","needed",")","More","code","examples","available","in","the","documentation","for","`","forward","`",".","For","a","more","comprehensive","overview","of","this","class",",","see",":","doc",":","`","our","detailed","walkthrough","<","..","\/example_usage\/input_space_manipulation",">","`","."]
code: def __init__(self, model, dataset):
      super(AttackerModel, self).__init__()
      self.normalizer = helpers.InputNormalize(
          dataset.mean, dataset.std
      )
      self.model = model
      self.attacker = Attacker(model, dataset)
  
file_path: robustness/robustness/attacker.py
imports: import torch
  import dill
  import os
  from .tools import helpers
  from .None import attack_steps
label_desc: Use image node_id 1 to create a new AttackerModel object from inherited base classes: ch.nn with example: obj = AttackerModel(model, dataset)