code: def test_fgsm_defences(
      art_warning, fix_get_mnist_subset, image_dl_estimator, device_type
  ):
      try:
          clip_values = (0, 1)
          smooth_3x3 = SpatialSmoothingPyTorch(
              window_size=3,
              channels_first=True,
              device_type=device_type,
          )
          smooth_5x5 = SpatialSmoothingPyTorch(
              window_size=5,
              channels_first=True,
              device_type=device_type,
          )
          smooth_7x7 = SpatialSmoothingPyTorch(
              window_size=7,
              channels_first=True,
              device_type=device_type,
          )
          classifier_, _ = image_dl_estimator()
  
          criterion = nn.CrossEntropyLoss()
          classifier = PyTorchClassifier(
              clip_values=clip_values,
              model=classifier_.model,
              preprocessing_defences=[
                  smooth_3x3,
                  smooth_5x5,
                  smooth_7x7,
              ],
              loss=criterion,
              input_shape=(1, 28, 28),
              nb_classes=10,
              device_type=device_type,
          )
          assert len(classifier.preprocessing_defences) == 3
  
          attack = FastGradientMethod(
              classifier, eps=1.0, batch_size=128
          )
          backend_test_defended_images(attack, fix_get_mnist_subset)
      except ARTTestException as e:
          art_warning(e)
  
imports: import numpy
  import pytest
  import torch
  import torch.nn.functional
  import torch.nn
  import torch.optim
  import sklearn.datasets
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.defences.preprocessor.spatial_smoothing import SpatialSmoothing
  from art.defences.preprocessor.spatial_smoothing_pytorch import SpatialSmoothingPyTorch
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.attacks.evasion.projected_gradient_descent.projected_gradient_descent import ProjectedGradientDescent
  from tests.attacks.utils import backend_test_defended_images
  from tests.utils import ARTTestException
label_desc: Use image node_id 9 for calling a global function with example usage: test_fgsm_defences(art_warning, fix_get_mnist_subset, image_dl_estimator, device_type) without return types