code: def test_exception(self, device, dtype):
      with pytest.raises(ValueError):
          im = torch.rand(5, 5, device=device, dtype=dtype)
          K = torch.rand(3, 3, device=device, dtype=dtype)
          distCoeff = torch.rand(4, device=device, dtype=dtype)
          undistort_image(im, K, distCoeff)
  
      with pytest.raises(ValueError):
          im = torch.rand(3, 5, 5, device=device, dtype=dtype)
          K = torch.rand(4, 4, device=device, dtype=dtype)
          distCoeff = torch.rand(4, device=device, dtype=dtype)
          undistort_image(im, K, distCoeff)
  
      with pytest.raises(ValueError):
          im = torch.rand(3, 5, 5, device=device, dtype=dtype)
          K = torch.rand(3, 3, device=device, dtype=dtype)
          distCoeff = torch.rand(6, device=device, dtype=dtype)
          undistort_image(im, K, distCoeff)
  
      with pytest.raises(ValueError):
          im = torch.randint(
              0, 256, (3, 5, 5), device=device, dtype=torch.uint8
          )
          K = torch.rand(3, 3, device=device, dtype=dtype)
          distCoeff = torch.rand(4, device=device, dtype=dtype)
          undistort_image(im, K, distCoeff)
  
      with pytest.raises(ValueError):
          im = torch.rand(1, 1, 3, 5, 5, device=device, dtype=dtype)
          K = torch.rand(1, 3, 3, device=device, dtype=dtype)
          distCoeff = torch.rand(1, 4, device=device, dtype=dtype)
          undistort_image(im, K, distCoeff)
  
imports: import pytest
  import torch
  from kornia.geometry.calibration.undistort import undistort_image, undistort_points
  from kornia.testing import assert_close, gradcheck
label_desc: Use image node_id 4 for calling the TestUndistortImage obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types