code: def test_exception(self, device, dtype):
      tensor = torch.ones(1, 1, 3, 4, device=device, dtype=dtype)
      kernel = torch.ones(3, 3, device=device, dtype=dtype)
  
      with pytest.raises(TypeError):
          assert erosion([0.0], kernel)
  
      with pytest.raises(TypeError):
          assert erosion(tensor, [0.0])
  
      with pytest.raises(ValueError):
          test = torch.ones(2, 3, 4, device=device, dtype=dtype)
          assert erosion(test, kernel)
  
      with pytest.raises(ValueError):
          test = torch.ones(2, 3, 4, device=device, dtype=dtype)
          assert erosion(tensor, test)
  
file_path: kornia/test/morphology/test_erosion.py
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  from kornia.morphology import erosion
  from kornia.testing import assert_close
label_desc: Use image node_id 6 for calling the TestErode obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types