class_docstr: Define a backward pass for a blackbox function using extra queries.
  Once wrapped, the blackbox function will become compatible with any attack
  in Advertorch, so long as self.training is True.
  
  Disclaimer: This wrapper assumes inputs will have shape [nbatch, ndim].
  For models that operate on images, you will need to wrap the function
  inside a reshaper.  See NESAttack for an example.
  
  :param func: A blackbox function.
      - This function must accept, and output, torch tensors.
class_docstr_tok: ["Define","a","backward","pass","for","a","blackbox","function","using","extra","queries",".","Once","wrapped",",","the","blackbox","function","will","become","compatible","with","any","attack","in","Advertorch",",","so","long","as","self.training","is","True",".","Disclaimer",":","This","wrapper","assumes","inputs","will","have","shape","[","nbatch",",","ndim","]",".","For","models","that","operate","on","images",",","you","will","need","to","wrap","the","function","inside","a","reshaper",".","See","NESAttack","for","an","example",".",":","param","func",":","A","blackbox","function",".","-","This","function","must","accept",",","and","output",",","torch","tensors","."]
code: def forward(self, x):
      if not self.training:
          output = self.func(x)
      else:
          output = self.diff_func(x)
  
      return output
  
file_path: advertorch/advertorch/attacks/blackbox/estimators.py
imports: import torch
  import numpy
label_desc: Use image node_id 4 for calling the GradientWrapper obj's underlying member method code with example usage: obj.forward(x) and returns: output