class_docstr: Create a module that computes the Structural Similarity (SSIM) index between two images.
  
  Measures the (SSIM) index between each element in the input `x` and target `y`.
  
  The index can be described as:
  
  .. math::
  
    \text{SSIM}(x, y) = \frac{(2\mu_x\mu_y+c_1)(2\sigma_{xy}+c_2)}
    {(\mu_x^2+\mu_y^2+c_1)(\sigma_x^2+\sigma_y^2+c_2)}
  
  where:
    - :math:`c_1=(k_1 L)^2` and :math:`c_2=(k_2 L)^2` are two variables to
      stabilize the division with weak denominator.
    - :math:`L` is the dynamic range of the pixel-values (typically this is
      :math:`2^{\#\text{bits per pixel}}-1`).
  
  Args:
      window_size: the size of the gaussian kernel to smooth the images.
      max_val: the dynamic range of the images.
      eps: Small value for numerically stability when dividing.
      padding: ``'same'`` | ``'valid'``. Whether to only use the "valid" convolution
       area to compute SSIM to match the MATLAB implementation of original SSIM paper.
  
  Shape:
      - Input: :math:`(B, C, H, W)`.
      - Target :math:`(B, C, H, W)`.
      - Output: :math:`(B, C, H, W)`.
  
  Examples:
      >>> input1 = torch.rand(1, 4, 5, 5)
      >>> input2 = torch.rand(1, 4, 5, 5)
      >>> ssim = SSIM(5)
      >>> ssim_map = ssim(input1, input2)  # 1x4x5x5
code: def __init__(
      self,
      window_size: int,
      max_val: float = 1.0,
      eps: float = 1e-12,
      padding: str = "same",
  ) -> None:
      super().__init__()
      self.window_size: int = window_size
      self.max_val: float = max_val
      self.eps = eps
      self.padding = padding
  
file_path: kornia/kornia/metrics/ssim.py
imports: from typing import List
  import torch
  from torch import nn
  from kornia.filters import filter2d_separable, get_gaussian_kernel1d
  from kornia.filters.filter import _compute_padding
label_desc: Use image node_id 1 to create a new SSIM object from inherited base classes: nn with example: obj = SSIM(window_size, max_val, eps, padding)