code: def compute_psnr(
      prediction: Tensor,
      target: Tensor,
      no_uint8_conversion: Optional[bool] = False,
  ) -> Tensor:
      if not no_uint8_conversion:
          prediction = prediction.mul(255.0).to(torch.uint8)
          target = target.mul(255.0).to(torch.uint8)
          MAX_I = 255**2
      else:
          MAX_I = 1
  
      error = torch.pow(prediction - target, 2).float()
      mse = torch.mean(error) + 1e-10
      psnr = 10.0 * torch.log10(MAX_I / mse)
      return psnr
  
file_path: ml-cvnets/metrics/psnr.py
imports: from typing import Any, Dict, Optional, Union
  import torch
  from torch import Tensor
  from metrics import METRICS_REGISTRY
  from metrics.metric_base import AverageMetric
  from utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: compute_psnr(prediction, target, no_uint8_conversion) and returns: psnr