code: def calculate_predicted_scores(
      self, inputs, additional_forward_args, model
  ) -> Tuple[
      List[OutputScore],
      Optional[List[Tuple[Tensor, ...]]],
      Tuple[Tensor, ...],
  ]:
      # Check if inputs have cached baselines and transformed inputs
      hashable_inputs = tuple(inputs)
      if hashable_inputs in self.baseline_cache:
          baselines_group = self.baseline_cache[hashable_inputs]
          transformed_inputs = self.transformed_input_cache[
              hashable_inputs
          ]
      else:
          # Initialize baselines
          baseline_transforms_len = 1  # todo support multiple baselines
          baselines: List[List[Optional[Tensor]]] = [
              [None] * len(self.features)
              for _ in range(baseline_transforms_len)
          ]
          transformed_inputs = list(inputs)
          for feature_i, feature in enumerate(self.features):
              transformed_inputs[feature_i] = self._transform(
                  feature.input_transforms,
                  transformed_inputs[feature_i],
                  True,
              )
              for baseline_i in range(baseline_transforms_len):
                  if baseline_i > len(feature.baseline_transforms) - 1:
                      baselines[baseline_i][
                          feature_i
                      ] = torch.zeros_like(
                          transformed_inputs[feature_i]
                      )
                  else:
                      baselines[baseline_i][
                          feature_i
                      ] = self._transform(
                          [feature.baseline_transforms[baseline_i]],
                          transformed_inputs[feature_i],
                          True,
                      )
  
          baselines = cast(List[List[Optional[Tensor]]], baselines)
          baselines_group = [tuple(b) for b in baselines]
          self.baseline_cache[hashable_inputs] = baselines_group
          self.transformed_input_cache[
              hashable_inputs
          ] = transformed_inputs
  
      outputs = _run_forward(
          model,
          tuple(transformed_inputs),
          additional_forward_args=additional_forward_args,
      )
  
      if self.score_func is not None:
          outputs = self.score_func(outputs)
  
      if outputs.nelement() == 1:
          scores = outputs
          predicted = scores.round().to(torch.int)
      else:
          scores, predicted = outputs.topk(min(4, outputs.shape[-1]))
  
      scores = scores.cpu().squeeze(0)
      predicted = predicted.cpu().squeeze(0)
  
      predicted_scores = self._get_labels_from_scores(scores, predicted)
  
      return (
          predicted_scores,
          baselines_group,
          tuple(transformed_inputs),
      )
  
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 2 for calling the AttributionCalculation obj's underlying member method code with example usage: obj.calculate_predicted_scores(inputs, additional_forward_args, model) and returns: predicted_scores,  baselines_group,  tuple