code: def _psnr_loss_fn(
      source: torch.Tensor, target: torch.Tensor, max_val: float
  ) -> torch.Tensor:
      torch._assert(
          source.shape == target.shape,
          "psnr_loss: source and target must have the same shape, but got {} and {}".format(
              source.shape, target.shape
          ),
      )
  
      # ref https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio
      return 10 * torch.log10(
          max_val**2
          / ((source - target).pow(2).mean(axis=(-3, -2, -1)))
      )
  
imports: from typing import List, Optional
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
  from torchvision.prototype.models.depth.stereo.raft_stereo import grid_sample, make_coords_grid
label_desc: Use image node_id 6 for calling a global function with example usage: _psnr_loss_fn(source, target, max_val) and returns: unknown