class_docstr: Abstract base class for preprocessing defences implemented in PyTorch that support efficient preprocessor-chaining.
docstr: Apply preprocessing to input `x` and labels `y`.
  
  :param x: Sample to smooth with shape `(batch_size, width, height, depth)`.
  :param y: Labels of the sample `x`. This function does not affect them in any way.
  :return: Smoothed sample.
docstr_tok: ["Apply","preprocessing","to","input","`","x","`","and","labels","`","y","`",".",":","param","x",":","Sample","to","smooth","with","shape","`","(","batch_size",",","width",",","height",",","depth",")","`",".",":","param","y",":","Labels","of","the","sample","`","x","`",".","This","function","does","not","affect","them","in","any","way",".",":","return",":","Smoothed","sample","."]
code: def __call__(
      self, x: np.ndarray, y: Optional[np.ndarray] = None
  ) -> Tuple[np.ndarray, Optional[np.ndarray]]:
      """
      Apply preprocessing to input `x` and labels `y`.
  
      :param x: Sample to smooth with shape `(batch_size, width, height, depth)`.
      :param y: Labels of the sample `x`. This function does not affect them in any way.
      :return: Smoothed sample.
      """
      import torch
  
      x_tensor = torch.tensor(x, device=self.device)
      if y is not None:
          y_tensor: Optional[torch.Tensor] = torch.tensor(
              y, device=self.device
          )
      else:
          y_tensor = None
  
      with torch.no_grad():
          x_tensor, y_tensor = self.forward(x_tensor, y_tensor)
  
      x_result = x_tensor.cpu().numpy()
      if y_tensor is not None:
          y_result: Optional[np.ndarray] = y_tensor.cpu().numpy()
      else:
          y_result = None
      return x_result, y_result
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import abc
  from typing import List, Optional, Tuple, Any, TYPE_CHECKING
  import numpy
  from art import config
label_desc: Use image node_id 5 for calling the PreprocessorPyTorch obj's underlying member method code with example usage: obj.__call__(x, y) and returns: x_result,  y_result