class_docstr: Criterion that computes the Welsch [2] (aka. Leclerc [3]) loss.
  
  According to [1], we compute the Welsch loss as follows:
  
  .. math::
  
      \text{WL}(x, y) = 1 - exp(-\frac{1}{2} (x - y)^{2})
  
  Where:
     - :math:`x` is the prediction.
     - :math:`y` is the target to be regressed to.
  
  Reference:
      [1] https://arxiv.org/pdf/1701.03077.pdf
      [2] https://www.tandfonline.com/doi/abs/10.1080/03610917808812083
      [3] https://link.springer.com/article/10.1007/BF00054839
  
  Args:
      reduction: Specifies the reduction to apply to the
        output: ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: no reduction
        will be applied (default), ``'mean'``: the sum of the output will be divided
        by the number of elements in the output, ``'sum'``: the output will be
        summed.
  
  Shape:
      - img1: the predicted tensor with shape :math:`(*)`.
      - img2: the target tensor with the same shape as img1.
  
  Example:
      >>> criterion = WelschLoss(reduction="mean")
      >>> img1 = torch.randn(2, 3, 32, 1904, requires_grad=True)
      >>> img2 = torch.randn(2, 3, 32, 1904)
      >>> output = criterion(img1, img2)
      >>> output.backward()
code: def forward(self, img1: Tensor, img2: Tensor) -> Tensor:
      return welsch_loss(img1=img1, img2=img2, reduction=self.reduction)
  
file_path: kornia/kornia/losses/welsch.py
imports: from __future__ import annotations
  from torch import Tensor
  from kornia.core import Module
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SAME_DEVICE, KORNIA_CHECK_SAME_SHAPE
label_desc: Use image node_id 2 for calling the WelschLoss obj's underlying member method code with example usage: obj.forward(img1, img2) and returns: welsch_loss