code: def calculate_net_contrib(
      self, attrs_per_input_feature: Tuple[Tensor, ...]
  ) -> List[float]:
      # get the net contribution per feature (input)
      net_contrib = torch.stack(
          [attrib.flatten().sum() for attrib in attrs_per_input_feature]
      )
  
      # normalise the contribution, s.t. sum(abs(x_i)) = 1
      norm = torch.norm(net_contrib, p=1)
      # if norm is 0, all net_contrib elements are 0
      net_contrib = safe_div(net_contrib, norm)
  
      return net_contrib.tolist()
  
file_path: captum/captum/insights/attr_vis/attribution_calculation.py
imports: import inspect
  from collections import namedtuple
  from typing import Callable, cast, Dict, Iterable, List, Optional, Sequence, Tuple, Union
  import torch
  from captum._utils.common import _run_forward, safe_div
  from captum.insights.attr_vis.config import ATTRIBUTION_METHOD_CONFIG, ATTRIBUTION_NAMES_TO_METHODS
  from captum.insights.attr_vis.features import BaseFeature
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 4 for calling the AttributionCalculation obj's underlying member method code with example usage: obj.calculate_net_contrib(attrs_per_input_feature) and returns: net_contrib