code: def test_one_feature(self) -> None:
      batch_size = 2
      classes = _get_classes()
      dataset = list(
          _labelled_img_data(
              num_labels=len(classes), num_samples=batch_size
          )
      )
  
      # NOTE: using DataLoader to batch the inputs
      # since AttributionVisualizer requires the input to be of size `B x ...`
      data_loader = torch.utils.data.DataLoader(
          list(dataset),
          batch_size=batch_size,
          shuffle=False,
          num_workers=0,
      )
  
      visualizer = AttributionVisualizer(
          models=[_get_cnn()],
          classes=classes,
          features=[
              ImageFeature(
                  "Photo",
                  input_transforms=[lambda x: x],
                  baseline_transforms=[lambda x: x * 0],
              )
          ],
          dataset=to_iter(data_loader),
          score_func=None,
      )
      visualizer._config = FilterConfig(
          attribution_arguments={"n_steps": 2}
      )
  
      outputs = visualizer.visualize()
  
      for output in outputs:
          total_contrib = sum(
              abs(f.contribution) for f in output[0].feature_outputs
          )
          self.assertAlmostEqual(total_contrib, 1.0, places=6)
  
imports: import unittest
  from typing import Callable, List, Union
  import torch
  import torch.nn
  from captum.insights import AttributionVisualizer, Batch
  from captum.insights.attr_vis.app import FilterConfig
  from captum.insights.attr_vis.features import BaseFeature, FeatureOutput, ImageFeature
  from tests.helpers.basic import BaseTest
label_desc: Use image node_id 1 for calling the Test obj's underlying member method code with example usage: obj.test_one_feature() without return types