class_docstr: A unittest class for testing the HopSkipJump attack.
class_docstr_tok: ["A","unittest","class","for","testing","the","HopSkipJump","attack","."]
code: def test_5_pytorch_resume(self):
      x_test = np.reshape(
          self.x_test_mnist, (self.x_test_mnist.shape[0], 1, 28, 28)
      ).astype(np.float32)
  
      # Build PyTorchClassifier
      ptc = get_image_classifier_pt()
  
      # HSJ attack
      hsj = HopSkipJump(
          classifier=ptc,
          targeted=True,
          max_iter=10,
          max_eval=100,
          init_eval=10,
          verbose=False,
      )
  
      params = {"y": self.y_test_mnist[2:3], "x_adv_init": x_test[2:3]}
      x_test_adv1 = hsj.generate(x_test[0:1], **params)
      diff1 = np.linalg.norm(x_test_adv1 - x_test)
  
      params.update(resume=True, x_adv_init=x_test_adv1)
      x_test_adv2 = hsj.generate(x_test[0:1], **params)
      params.update(x_adv_init=x_test_adv2)
      x_test_adv2 = hsj.generate(x_test[0:1], **params)
      diff2 = np.linalg.norm(x_test_adv2 - x_test)
  
      self.assertGreater(diff1, diff2)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import keras.backend
  import numpy
  from art.attacks.evasion.hop_skip_jump import HopSkipJump
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification import ClassifierMixin
  from art.utils import random_targets
  from tests.utils import TestBase
  from tests.utils import get_image_classifier_tf, get_image_classifier_kr, get_image_classifier_pt
  from tests.utils import get_tabular_classifier_pt, master_seed
  from tests.attacks.utils import backend_test_classifier_type_check_fail
label_desc: Use image node_id 5 for calling the TestHopSkipJump obj's underlying member method code with example usage: obj.test_5_pytorch_resume() without return types