class_docstr: Interface class for the two De-randomized smoothing approaches supported by ART for pytorch.
  
  If a regular pytorch neural network is fed in then (De)Randomized Smoothing as introduced in Levine et al. (2020)
  is used.
  
  Otherwise, if a timm vision transfomer is fed in then Certified Patch Robustness via Smoothed Vision Transformers
  as introduced in Salman et al. (2021) is used.
code: def _predict_classifier(
      self,
      x: Union[np.ndarray, "torch.Tensor"],
      batch_size: int,
      training_mode: bool,
      **kwargs,
  ) -> np.ndarray:
      import torch
  
      if isinstance(x, torch.Tensor):
          x_numpy = x.cpu().numpy()
  
      outputs = PyTorchClassifier.predict(
          self,
          x=x_numpy,
          batch_size=batch_size,
          training_mode=training_mode,
          **kwargs,
      )
  
      if self.algorithm == "levine2020":
          if not self.logits:
              return np.asarray((outputs >= self.threshold))
          return np.asarray(
              (
                  torch.nn.functional.softmax(
                      torch.from_numpy(outputs), dim=1
                  )
                  >= self.threshold
              ).type(torch.int)
          )
      return outputs
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import importlib
  import logging
  from typing import List, Optional, Tuple, Union, Any, TYPE_CHECKING
  import random
  import numpy
  from tqdm import tqdm
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.estimators.certification.derandomized_smoothing.derandomized import DeRandomizedSmoothingMixin
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 8 for calling the PyTorchDeRandomizedSmoothing obj's underlying member method code with example usage: obj._predict_classifier(x, batch_size, training_mode) and returns: outputs, np, np