code: def __init__(
      self,
      model,
      loss,
      bounds,
      channel_axis=3,
      nb_classes=10,
      preprocess=None,
  ):
      import torch
  
      if preprocess is None:
          preprocess = (0, 1)
  
      super(PytorchModel, self).__init__(
          bounds=bounds,
          channel_axis=channel_axis,
          preprocess=preprocess,
      )
  
      self._model = model
  
      # 暂时不支持自定义loss
      self._loss = loss
  
      self._nb_classes = nb_classes
  
      self._device = torch.device(
          "cuda" if torch.cuda.is_available() else "cpu"
      )
  
      print(self._device)
  
      logger.info("Finish PytorchModel init")
  
file_path: AdvBox/adversarialbox/models/pytorch.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  import numpy
  import os
  from .base import Model
  import logging
  import torchvision
  from torch.autograd import Variable
  import torch.nn
label_desc: Use image node_id 1 to create a new PytorchModel object from inherited base classes: Model with example: obj = PytorchModel(model, loss, bounds, channel_axis, nb_classes, preprocess)