code: def js_div_loss_2d(
      pred: Tensor, target: Tensor, reduction: str = "mean"
  ) -> Tensor:
      r"""Calculate the Jensen-Shannon divergence loss between heatmaps.
  
      Args:
          pred: the input tensor with shape :math:`(B, N, H, W)`.
          target: the target tensor with shape :math:`(B, N, H, W)`.
          reduction: Specifies the reduction to apply to the
            output: ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: no reduction
            will be applied, ``'mean'``: the sum of the output will be divided by
            the number of elements in the output, ``'sum'``: the output will be
            summed.
  
      Examples:
          >>> pred = torch.full((1, 1, 2, 4), 0.125)
          >>> loss = js_div_loss_2d(pred, pred)
          >>> loss.item()
          0.0
      """
      return _reduce_loss(_js_div_2d(target, pred), reduction)
  
file_path: kornia/kornia/losses/divergence.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from kornia.core import Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: js_div_loss_2d(pred, target, reduction) and returns: _reduce_loss