class_docstr: Finite-Difference Estimator.
  For every backward pass, this module makes 2 * n_dim queries per
  instance.
  
  :param func: A blackbox function.
      - This function must accept, and output, torch tensors.
  :param fd_eta: Step-size used for the finite-difference estimation.
class_docstr_tok: ["Finite-Difference","Estimator",".","For","every","backward","pass",",","this","module","makes","2","*","n_dim","queries","per","instance",".",":","param","func",":","A","blackbox","function",".","-","This","function","must","accept",",","and","output",",","torch","tensors",".",":","param","fd_eta",":","Step-size","used","for","the","finite-difference","estimation","."]
code: def estimate_grad(self, x):
      id_mat = torch.diag(torch.ones_like(x[0]))  # shape [D,D]
      fxp = self.batch_query(
          x[:, :, None] + self.fd_eta * id_mat[None, :, :]
      )
  
      fxm = self.batch_query(
          x[:, :, None] - self.fd_eta * id_mat[None, :, :]
      )
  
      grad_est = (fxp - fxm) / (2.0 * self.fd_eta)
      return grad_est
  
file_path: advertorch/advertorch/attacks/blackbox/estimators.py
imports: import torch
  import numpy
label_desc: Use image node_id 2 for calling the FDWrapper obj's underlying member method code with example usage: obj.estimate_grad(x) and returns: grad_est