code: def test_shape(self, cam_name):
      model = DenseNet(
          spatial_dims=3,
          in_channels=1,
          out_channels=3,
          init_features=2,
          growth_rate=2,
          block_config=(6,),
      )
      device = "cuda:0" if torch.cuda.is_available() else "cpu"
      model.to(device)
      model.eval()
  
      image = torch.rand((2, 1, 6, 6, 6), device=device)
      target_layer = "class_layers.relu"
      fc_layer = "class_layers.out"
      if cam_name == "CAM":
          inferer = SaliencyInferer(
              cam_name,
              target_layer,
              None,
              fc_layer,
              upsampler=default_upsampler,
          )
          result = inferer(inputs=image, network=model, layer_idx=-1)
      else:
          inferer = SaliencyInferer(
              cam_name, target_layer, None, upsampler=default_upsampler
          )
          result = inferer(image, model, -1, retain_graph=False)
  
      self.assertTupleEqual(result.shape, (2, 1, 6, 6, 6))
  
file_path: MONAI/tests/test_saliency_inferer.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.inferers import SaliencyInferer
  from monai.networks.nets import DenseNet
  from monai.visualize.visualizer import default_upsampler
label_desc: Use image node_id 1 for calling the TestSaliencyInferer obj's underlying member method code with example usage: obj.test_shape(cam_name) without return types