code: def test_5_pytorch_mnist(self):
      x_train_mnist = np.swapaxes(self.x_train_mnist, 1, 3).astype(
          np.float32
      )
      x_test_mnist = np.swapaxes(self.x_test_mnist, 1, 3).astype(
          np.float32
      )
      classifier = get_image_classifier_pt()
  
      scores = get_labels_np_array(classifier.predict(x_train_mnist))
      acc = (
          np.sum(
              np.argmax(scores, axis=1)
              == np.argmax(self.y_train_mnist, axis=1)
          )
          / self.y_train_mnist.shape[0]
      )
      logger.info(
          "[PyTorch, MNIST] Accuracy on training set: %.2f%%", acc * 100
      )
  
      scores = get_labels_np_array(classifier.predict(x_test_mnist))
      acc = (
          np.sum(
              np.argmax(scores, axis=1)
              == np.argmax(self.y_test_mnist, axis=1)
          )
          / self.y_test_mnist.shape[0]
      )
      logger.info(
          "[PyTorch, MNIST] Accuracy on test set: %.2f%%", acc * 100
      )
  
      self._test_backend_mnist(
          classifier,
          x_train_mnist,
          self.y_train_mnist,
          x_test_mnist,
          self.y_test_mnist,
      )
  
      # Test with clip values of array type
      classifier.set_params(
          clip_values=(
              np.zeros_like(x_test_mnist[0]),
              np.ones_like(x_test_mnist[0]),
          )
      )
      self._test_backend_mnist(
          classifier,
          x_train_mnist,
          self.y_train_mnist,
          x_test_mnist,
          self.y_test_mnist,
      )
  
      classifier.set_params(
          clip_values=(
              np.zeros_like(x_test_mnist[0][0]),
              np.ones_like(x_test_mnist[0][0]),
          )
      )
      self._test_backend_mnist(
          classifier,
          x_train_mnist,
          self.y_train_mnist,
          x_test_mnist,
          self.y_test_mnist,
      )
  
      classifier.set_params(
          clip_values=(
              np.zeros_like(x_test_mnist[0][0][0]),
              np.ones_like(x_test_mnist[0][0][0]),
          )
      )
      self._test_backend_mnist(
          classifier,
          x_train_mnist,
          self.y_train_mnist,
          x_test_mnist,
          self.y_test_mnist,
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import numpy
  import tensorflow
  from art.attacks.evasion.projected_gradient_descent.projected_gradient_descent import ProjectedGradientDescent
  from art.attacks.evasion.projected_gradient_descent.projected_gradient_descent_numpy import ProjectedGradientDescentNumpy, ProjectedGradientDescentCommon
  from art.estimators.classification import KerasClassifier
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.utils import get_labels_np_array, random_targets
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import TestBase, get_image_classifier_kr, get_image_classifier_pt, get_image_classifier_tf, get_tabular_classifier_kr, get_tabular_classifier_pt, get_tabular_classifier_tf, master_seed
label_desc: Use image node_id 5 for calling the TestPGD obj's underlying member method code with example usage: obj.test_5_pytorch_mnist() without return types