code: def test_exception(self, device, dtype):
      ex = torch.ones(1, device=device, dtype=dtype)
      with pytest.raises(TypeError) as errinfo:
          elastic_transform2d([0.0], ex)
      assert "Not a Tensor type" in str(errinfo.value)
  
      with pytest.raises(TypeError) as errinfo:
          elastic_transform2d(ex, 1)
      assert "Not a Tensor type" in str(errinfo.value)
  
      with pytest.raises(TypeError) as errinfo:
          img = torch.ones(1, 1, 1, device=device, dtype=dtype)
          noise = torch.ones(1, 2, 1, 1, device=device, dtype=dtype)
          elastic_transform2d(img, noise)
      assert "shape must be [['B', 'C', 'H', 'W']]" in str(
          errinfo.value
      )
  
      with pytest.raises(TypeError) as errinfo:
          img = torch.ones(1, 1, 1, 1, device=device, dtype=dtype)
          noise = torch.ones(2, 1, 1, device=device, dtype=dtype)
          elastic_transform2d(img, noise)
      assert "shape must be [['B', 'C', 'H', 'W']]" in str(
          errinfo.value
      )
  
      with pytest.raises(RuntimeError) as errinfo:
          img = torch.ones(1, 1, 1, 1, device=device, dtype=dtype)
          noise = torch.ones(1, 3, 1, 1, device=device, dtype=dtype)
          elastic_transform2d(img, noise)
      assert (
          "The size of tensor a (2) must match the size of tensor b (3)"
          in str(errinfo.value)
      )
  
file_path: kornia/test/geometry/transform/test_elastic_transform.py
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  from kornia.geometry.transform import elastic_transform2d
  from kornia.testing import assert_close
label_desc: Use image node_id 3 for calling the TestElasticTransform obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types