code: def test_shape(self, vis_type, model, shape):
      device = "cuda:0" if torch.cuda.is_available() else "cpu"
  
      # optionally test for adjoint info
      kwargs = (
          {"adjoint_info": 42}
          if isinstance(model, DenseNetAdjoint)
          else {}
      )
  
      model.to(device)
      model.eval()
      vis = vis_type(model)
      x = torch.rand(shape, device=device)
      result = vis(x, **kwargs)
      self.assertTupleEqual(result.shape, x.shape)
  
file_path: MONAI/tests/test_vis_gradbased.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.networks.nets import DenseNet, DenseNet121, SEResNet50
  from monai.visualize import GuidedBackpropGrad, GuidedBackpropSmoothGrad, SmoothGrad, VanillaGrad
label_desc: Use image node_id 1 for calling the TestGradientClassActivationMap obj's underlying member method code with example usage: obj.test_shape(vis_type, model, shape) without return types