code: def minkowski_distance(
      preds: Tensor, targets: Tensor, p: float
  ) -> Tensor:
      r"""Compute the `Minkowski distance`_.
  
      .. math:: d_{\text{Minkowski}} = \\sum_{i}^N (| y_i - \\hat{y_i} |^p)^\frac{1}{p}
  
      This metric can be seen as generalized version of the standard euclidean distance which corresponds to minkowski
      distance with p=2.
  
      Args:
          preds: estimated labels of type Tensor
          targets: ground truth labels of type Tensor
          p: int or float larger than 1, exponent to which the difference between preds and target is to be raised
  
      Return:
          Tensor with the Minkowski distance
  
      Example:
          >>> from torchmetrics.functional.regression import minkowski_distance
          >>> x = torch.tensor([1.0, 2.8, 3.5, 4.5])
          >>> y = torch.tensor([6.1, 2.11, 3.1, 5.6])
          >>> minkowski_distance(x, y, p=3)
          tensor(5.1220)
  
      """
      minkowski_dist_sum = _minkowski_distance_update(preds, targets, p)
      return _minkowski_distance_compute(minkowski_dist_sum, p)
  
imports: import torch
  from torch import Tensor
  from torchmetrics.utilities.checks import _check_same_shape
  from torchmetrics.utilities.exceptions import TorchMetricsUserError
label_desc: Use image node_id 3 for calling a global function with example usage: minkowski_distance(preds, targets, p) and returns: _minkowski_distance_compute