code: def _ssim_compute(
      similarities: Tensor,
      reduction: Literal[
          "elementwise_mean", "sum", "none", None
      ] = "elementwise_mean",
  ) -> Tensor:
      """Apply the specified reduction to pre-computed structural similarity.
  
      Args:
          similarities: per image similarities for a batch of images.
          reduction: a method to reduce metric score over individual batch scores
  
                  - ``'elementwise_mean'``: takes the mean
                  - ``'sum'``: takes the sum
                  - ``'none'`` or ``None``: no reduction will be applied
  
      Returns:
          The reduced SSIM score
  
      """
      return reduce(similarities, reduction)
  
file_path: torchmetrics/src/torchmetrics/functional/image/ssim.py
imports: from typing import List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import functional
  from typing_extensions import Literal
  from torchmetrics.functional.image.helper import _gaussian_kernel_2d, _gaussian_kernel_3d, _reflection_pad_3d
  from torchmetrics.utilities.checks import _check_same_shape
  from torchmetrics.utilities.distributed import reduce
label_desc: Use image node_id 3 for calling a global function with example usage: _ssim_compute(similarities, reduction) and returns: reduce