class_docstr: A perturbation based approach to compute attribution, based on the concept
  of Shapley Values from cooperative game theory. This method involves taking
  a random permutation of the input features and adding them one-by-one to the
  given baseline. The output difference after adding each feature corresponds
  to its attribution, and these difference are averaged when repeating this
  process n_samples times, each time choosing a new random permutation of
  the input features.
  
  By default, each scalar value within
  the input tensors are taken as a feature and added independently. Passing
  a feature mask, allows grouping features to be added together. This can
  be used in cases such as images, where an entire segment or region
  can be grouped together, measuring the importance of the segment
  (feature group). Each input scalar in the group will be given the same
  attribution value equal to the change in output as a result of adding back
  the entire feature group.
  
  More details regarding Shapley Value sampling can be found in these papers:
  https://www.sciencedirect.com/science/article/pii/S0305054808000804
  https://pdfs.semanticscholar.org/7715/bb1070691455d1fcfc6346ff458dbca77b2c.pdf
class_docstr_tok: ["A","perturbation","based","approach","to","compute","attribution",",","based","on","the","concept","of","Shapley","Values","from","cooperative","game","theory",".","This","method","involves","taking","a","random","permutation","of","the","input","features","and","adding","them","one-by-one","to","the","given","baseline",".","The","output","difference","after","adding","each","feature","corresponds","to","its","attribution",",","and","these","difference","are","averaged","when","repeating","this","process","n_samples","times",",","each","time","choosing","a","new","random","permutation","of","the","input","features",".","By","default",",","each","scalar","value","within","the","input","tensors","are","taken","as","a","feature","and","added","independently",".","Passing","a","feature","mask",",","allows","grouping","features","to","be","added","together",".","This","can","be","used","in","cases","such","as","images",",","where","an","entire","segment","or","region","can","be","grouped","together",",","measuring","the","importance","of","the","segment","(","feature","group",")",".","Each","input","scalar","in","the","group","will","be","given","the","same","attribution","value","equal","to","the","change","in","output","as","a","result","of","adding","back","the","entire","feature","group",".","More","details","regarding","Shapley","Value","sampling","can","be","found","in","these","papers",":","https",":","\/\/www.sciencedirect.com\/science\/article\/pii\/S0305054808000804","https",":","\/\/pdfs.semanticscholar.org\/7715\/bb1070691455d1fcfc6346ff458dbca77b2c.pdf"]
docstr: return the total number of forward evaluations needed
docstr_tok: ["return","the","total","number","of","forward","evaluations","needed"]
code: def _get_n_evaluations(
      self, total_features, n_samples, perturbations_per_eval
  ):
      """return the total number of forward evaluations needed"""
      return (
          math.ceil(total_features / perturbations_per_eval) * n_samples
      )
  
imports: import itertools
  import math
  import warnings
  from typing import Any, Callable, Iterable, Sequence, Tuple, Union
  import torch
  from captum._utils.common import _expand_additional_forward_args, _expand_target, _format_additional_forward_args, _format_feature_mask, _format_output, _format_tensor_into_tuples, _get_max_feature_index, _is_mask_valid, _is_tuple, _run_forward
  from captum._utils.progress import progress
  from captum._utils.typing import BaselineType, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.attribution import PerturbationAttribution
  from captum.attr._utils.common import _find_output_mode_and_verify, _format_input_baseline, _tensorize_baseline
  from captum.log import log_usage
  from torch import Tensor
label_desc: Use image node_id 4 for calling the ShapleyValueSampling obj's underlying member method code with example usage: obj._get_n_evaluations(total_features, n_samples, perturbations_per_eval) and returns: unknown