class_docstr: Abstract base class for preprocessing defences implemented in PyTorch that support efficient preprocessor-chaining.
code: def __init__(self, device_type: str = "gpu", **kwargs):
      import torch
  
      super().__init__(**kwargs)
  
      # Set device
      if device_type == "cpu" or not torch.cuda.is_available():
          self._device = torch.device("cpu")
      else:  # pragma: no cover
          cuda_idx = torch.cuda.current_device()
          self._device = torch.device(f"cuda:{cuda_idx}")
  
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 1 to create a new PreprocessorPyTorch object from inherited base classes: Preprocessor with example: obj = PreprocessorPyTorch(device_type)