code: def test_exception(self):
      k = torch.ones(1, 1, 1)
      inpt = torch.ones(1, 1, 1, 1)
      with pytest.raises(TypeError) as errinfo:
          filter2d(1, k)
      assert "Not a Tensor type." in str(errinfo)
  
      with pytest.raises(TypeError) as errinfo:
          filter2d(inpt, 1)
      assert "Not a Tensor type." in str(errinfo)
  
      with pytest.raises(TypeError) as errinfo:
          filter2d(torch.ones(1), k)
      assert "shape must be [['B', 'C', 'H', 'W']]" in str(errinfo)
  
      with pytest.raises(TypeError) as errinfo:
          filter2d(inpt, torch.ones(1))
      assert "shape must be [['B', 'H', 'W']]" in str(errinfo)
  
      with pytest.raises(Exception) as errinfo:
          filter2d(inpt, k, border_type="a")
      assert "Invalid border, gotcha a. Ex" in str(errinfo)
  
      with pytest.raises(Exception) as errinfo:
          filter2d(inpt, k, padding="a")
      assert "Invalid padding mode, gotcha a. Ex" in str(errinfo)
  
imports: import pytest
  import torch
  from kornia.filters import DexiNed, filter2d, filter2d_separable, filter3d
  from kornia.testing import BaseTester, assert_close, tensor_to_gradcheck_var
  from kornia.utils._compat import torch_version_le
label_desc: Use image node_id 4 for calling the TestFilter2D obj's underlying member method code with example usage: obj.test_exception() without return types