code: def test_defenses_nograd(device, def_cls):
      with pytest.raises((RuntimeError, NotImplementedError)):
          defense = def_cls(**defense_kwargs[def_cls])
          data = defense_data[def_cls]
          data.requires_grad_()
          loss = defense(data).sum()
          loss.backward()
  
file_path: advertorch/tests/test_defenses_running.py
imports: import itertools
  import pytest
  import torch
  import torch.nn
  from advertorch.test_utils import vecdata
  from advertorch.test_utils import vecmodel
  from advertorch.test_utils import imgdata
  from advertorch.test_utils import imgmodel
  from advertorch.test_utils import general_input_defenses
  from advertorch.test_utils import image_only_defenses
  from advertorch.test_utils import withgrad_defenses
  from advertorch.test_utils import nograd_defenses
  from advertorch.test_utils import defense_kwargs
  from advertorch.test_utils import defense_data
label_desc: Use image node_id 5 for calling a global function with example usage: test_defenses_nograd(device, def_cls) without return types