class_docstr: Layer attribution provides attribution values for the given layer, quantifying
  the importance of each neuron within the given layer's output. The output
  attribution of calling attribute on a LayerAttribution object always matches
  the size of the layer output.
class_docstr_tok: ["Layer","attribution","provides","attribution","values","for","the","given","layer",",","quantifying","the","importance","of","each","neuron","within","the","given","layer","'s","output",".","The","output","attribution","of","calling","attribute","on","a","LayerAttribution","object","always","matches","the","size","of","the","layer","output","."]
docstr: Interpolates given 3D, 4D or 5D layer attribution to given dimensions.
  This is often utilized to upsample the attribution of a convolutional layer
  to the size of an input, which allows visualizing in the input space.
  
  Args:
  
      layer_attribution (Tensor): Tensor of given layer attributions.
      interpolate_dims (int or tuple): Upsampled dimensions. The
                  number of elements must be the number of dimensions
                  of layer_attribution - 2, since the first dimension
                  corresponds to number of examples and the second is
                  assumed to correspond to the number of channels.
      interpolate_mode (str): Method for interpolation, which
                  must be a valid input interpolation mode for
                  torch.nn.functional. These methods are
                  "nearest", "area", "linear" (3D-only), "bilinear"
                  (4D-only), "bicubic" (4D-only), "trilinear" (5D-only)
                  based on the number of dimensions of the given layer
                  attribution.
  
  Returns:
      *Tensor* of upsampled **attributions**:
      - **attributions** (*Tensor*):
          Upsampled layer attributions with first 2 dimensions matching
          slayer_attribution and remaining dimensions given by
          interpolate_dims.
docstr_tok: ["Interpolates","given","3D",",","4D","or","5D","layer","attribution","to","given","dimensions",".","This","is","often","utilized","to","upsample","the","attribution","of","a","convolutional","layer","to","the","size","of","an","input",",","which","allows","visualizing","in","the","input","space",".","Args",":","layer_attribution","(","Tensor",")",":","Tensor","of","given","layer","attributions",".","interpolate_dims","(","int","or","tuple",")",":","Upsampled","dimensions",".","The","number","of","elements","must","be","the","number","of","dimensions","of","layer_attribution","-","2",",","since","the","first","dimension","corresponds","to","number","of","examples","and","the","second","is","assumed","to","correspond","to","the","number","of","channels",".","interpolate_mode","(","str",")",":","Method","for","interpolation",",","which","must","be","a","valid","input","interpolation","mode","for","torch.nn.functional",".","These","methods","are","``","nearest","''",",","``","area","''",",","``","linear","''","(","3D-only",")",",","``","bilinear","''","(","4D-only",")",",","``","bicubic","''","(","4D-only",")",",","``","trilinear","''","(","5D-only",")","based","on","the","number","of","dimensions","of","the","given","layer","attribution",".","Returns",":","*","Tensor","*","of","upsampled","*","*","attributions","*","*",":","-","*","*","attributions","*","*","(","*","Tensor","*",")",":","Upsampled","layer","attributions","with","first","2","dimensions","matching","slayer_attribution","and","remaining","dimensions","given","by","interpolate_dims","."]
code: def interpolate(
      layer_attribution: Tensor,
      interpolate_dims: Union[int, Tuple[int, ...]],
      interpolate_mode: str = "nearest",
  ) -> Tensor:
      r"""
      Interpolates given 3D, 4D or 5D layer attribution to given dimensions.
      This is often utilized to upsample the attribution of a convolutional layer
      to the size of an input, which allows visualizing in the input space.
  
      Args:
  
          layer_attribution (Tensor): Tensor of given layer attributions.
          interpolate_dims (int or tuple): Upsampled dimensions. The
                      number of elements must be the number of dimensions
                      of layer_attribution - 2, since the first dimension
                      corresponds to number of examples and the second is
                      assumed to correspond to the number of channels.
          interpolate_mode (str): Method for interpolation, which
                      must be a valid input interpolation mode for
                      torch.nn.functional. These methods are
                      "nearest", "area", "linear" (3D-only), "bilinear"
                      (4D-only), "bicubic" (4D-only), "trilinear" (5D-only)
                      based on the number of dimensions of the given layer
                      attribution.
  
      Returns:
          *Tensor* of upsampled **attributions**:
          - **attributions** (*Tensor*):
              Upsampled layer attributions with first 2 dimensions matching
              slayer_attribution and remaining dimensions given by
              interpolate_dims.
      """
      return F.interpolate(
          layer_attribution, interpolate_dims, mode=interpolate_mode
      )
  
imports: from typing import Any, Callable, cast, Generic, List, Tuple, Type, Union
  import torch
  import torch.nn.functional
  from captum._utils.common import _format_additional_forward_args, _format_tensor_into_tuples, _run_forward, _validate_target
  from captum._utils.gradient import compute_gradients
  from captum._utils.typing import ModuleOrModuleList, TargetType
  from captum.attr._utils.common import _format_input_baseline, _sum_rows, _tensorize_baseline, _validate_input
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 2 for calling the LayerAttribution obj's underlying member method code with example usage: obj.interpolate(layer_attribution, interpolate_dims, interpolate_mode) and returns: F