code: def test_generate(
      art_warning,
      fix_get_mnist_subset,
      image_dl_estimator_for_attack,
      framework,
      loss_type,
      norm,
  ):
      print("test_generate")
      try:
          classifier = image_dl_estimator_for_attack(
              AutoProjectedGradientDescent, from_logits=True
          )
  
          print("framework", framework)
  
          if (
              framework in ["tensorflow1", "tensorflow2v1"]
              and loss_type == "difference_logits_ratio"
          ):
              with pytest.raises(ValueError):
                  _ = AutoProjectedGradientDescent(
                      estimator=classifier,
                      norm=norm,
                      eps=0.3,
                      eps_step=0.1,
                      max_iter=5,
                      targeted=False,
                      nb_random_init=1,
                      batch_size=32,
                      loss_type=loss_type,
                      verbose=False,
                  )
          else:
              attack = AutoProjectedGradientDescent(
                  estimator=classifier,
                  norm=norm,
                  eps=0.3,
                  eps_step=0.1,
                  max_iter=5,
                  targeted=False,
                  nb_random_init=1,
                  batch_size=32,
                  loss_type=loss_type,
                  verbose=False,
              )
  
              (
                  x_train_mnist,
                  y_train_mnist,
                  x_test_mnist,
                  y_test_mnist,
              ) = fix_get_mnist_subset
  
              x_train_mnist_adv = attack.generate(
                  x=x_train_mnist, y=y_train_mnist
              )
  
              assert (
                  np.max(np.abs(x_train_mnist_adv - x_train_mnist))
                  > 0.0
              )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_auto_projected_gradient_descent.py
imports: import logging
  import pytest
  import numpy
  from art.attacks.evasion import AutoProjectedGradientDescent
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import ARTTestException
label_desc: Use image node_id 2 for calling a global function with example usage: test_generate(art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack, framework, loss_type, norm) without return types