code: def test_invalid_psnr():
      y_pred = torch.rand(1, 3, 8, 8)
      y = torch.rand(1, 3, 8, 8)
  
      psnr = PSNR(1.0)
      with pytest.raises(
          TypeError,
          match="Expected y_pred and y to have the same data type.",
      ):
          psnr.update((y_pred, y.double()))
  
      with pytest.raises(
          ValueError,
          match="Expected y_pred and y to have the same shape.",
      ):
          psnr.update((y_pred, y.squeeze(dim=0)))
  
file_path: ignite/tests/ignite/metrics/test_psnr.py
imports: import numpy
  import pytest
  import torch
  from skimage.metrics import peak_signal_noise_ratio
  import ignite.distributed
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
  from ignite.metrics import PSNR
  from ignite.utils import manual_seed
label_desc: Use image node_id 2 for calling a global function with example usage: test_invalid_psnr() without return types