code: def test_dl_attr_not_return_input_shape(self) -> None:
      forward = sum_forward
      fa = FeatureAblation(forward)
      dl_fa = DataLoaderAttribution(fa)
  
      dataloader = DataLoader(mock_dataset, batch_size=2)
  
      dl_attribution = dl_fa.attribute(
          dataloader, return_input_shape=False
      )
  
      expected_attr_shape = (len(mock_dataset), 7)
  
      self.assertEqual(type(dl_attribution), Tensor)
      dl_attribution = cast(Tensor, dl_attribution)
      self.assertEqual(dl_attribution.shape, expected_attr_shape)
  
      # default reduce of DataLoaderAttribution works the same as concat all batches
      attr_list = []
      for batch in dataloader:
          batch_attr = fa.attribute(tuple(batch))
          attr_list.append(batch_attr)
  
      expected_attr = torch.cat(
          [
              # flatten feature dim
              torch.cat(feature_attrs, dim=0).flatten(start_dim=1)
              for feature_attrs in zip(*attr_list)
          ],
          dim=1,
      )
  
      assertTensorAlmostEqual(self, dl_attribution, expected_attr)
  
imports: import math
  from typing import cast
  from unittest.mock import Mock, patch
  import torch
  from captum.attr._core.dataloader_attr import DataLoaderAttribution, InputRole
  from captum.attr._core.feature_ablation import FeatureAblation
  from parameterized import parameterized
  from tests.helpers.basic import assertAttributionComparision, assertTensorAlmostEqual, BaseTest
  from torch import Tensor
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 6 for calling the Test obj's underlying member method code with example usage: obj.test_dl_attr_not_return_input_shape() without return types