code: def test_exception(self, device, dtype):
      with pytest.raises(TypeError) as errinfo:
          criterion = kornia.metrics.AEPE()
          criterion(
              None, torch.ones(4, 4, 2, device=device, dtype=dtype)
          )
      assert "Not a Tensor type. Got" in str(errinfo)
  
      with pytest.raises(NotImplementedError) as errinfo:
          sample = torch.ones(4, 4, 2, device=device, dtype=dtype)
          _ = kornia.metrics.aepe(sample, 2.0 * sample, reduction="foo")
      assert "Invalid reduction option." in str(errinfo)
  
      with pytest.raises(Exception) as errinfo:
          sample = torch.ones(4, 4, 2, device=device, dtype=dtype)
          _ = kornia.metrics.aepe(
              sample, 2.0 * sample[..., 0], reduction="mean"
          )
      assert "shape must be [['*', '2']]. Got" in str(errinfo)
  
imports: import pytest
  import torch
  import kornia
  from kornia.testing import BaseTester, assert_close, tensor_to_gradcheck_var
label_desc: Use image node_id 6 for calling the TestAepe obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types