code: def test_exception(self, device, dtype):
      with pytest.raises(Exception) as errinfo:
          Canny(0.3, 0.2)
      assert (
          "low_threshold should be smaller than the high_threshold"
          in str(errinfo)
      )
  
      with pytest.raises(Exception) as errinfo:
          Canny(-2, 0.3)
      assert "Invalid low threshold." in str(errinfo)
  
      with pytest.raises(Exception) as errinfo:
          Canny(0.1, 3)
      assert "Invalid high threshold." in str(errinfo)
  
      with pytest.raises(Exception) as errinfo:
          canny(1)
      assert "Not a Tensor type" in str(errinfo)
  
      inp = torch.zeros(3, 4, 4, device=device, dtype=dtype)
      with pytest.raises(Exception) as errinfo:
          canny(inp)
      assert "shape must be [['B', 'C', 'H', 'W']]" in str(errinfo)
  
file_path: kornia/test/filters/test_canny.py
imports: import pytest
  import torch
  from kornia.filters import Canny, canny
  from kornia.testing import BaseTester, tensor_to_gradcheck_var
  from kornia.utils._compat import torch_version
label_desc: Use image node_id 3 for calling the TestCanny obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types