code: def test_bpda_on_nograd_defense(device, def_cls):
      defense = def_cls(**defense_kwargs[def_cls])
  
      defense = BPDAWrapper(defense, forwardsub=_identity)
      _calc_datagrad_on_defense(defense, defense_data[def_cls])
  
      defense = BPDAWrapper(
          defense, backward=_straight_through_backward
      )
      _calc_datagrad_on_defense(defense, defense_data[def_cls])
  
file_path: advertorch/tests/test_bpda.py
imports: import itertools
  import pytest
  import torch
  import torch.nn
  from advertorch.bpda import BPDAWrapper
  from advertorch.utils import torch_allclose
  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
  from advertorch.test_utils import vecdata
label_desc: Use image node_id 4 for calling a global function with example usage: test_bpda_on_nograd_defense(device, def_cls) without return types