code: def test_exception(self, device, dtype):
      torch.manual_seed(22)
      image = torch.rand(1, 3, 2, 2, device=device, dtype=torch.float64)
      mask = torch.randint(
          0, 2, (1, 2, 2), device=device, dtype=torch.float64
      )
      f = RandomTransplantation(p=1.0)
      f(image, mask)
      params = f._params
  
      with pytest.raises(
          Exception, match="excluded_labels must be a 1-dimensional"
      ):
          RandomTransplantation(
              p=1.0,
              excluded_labels=torch.tensor(
                  [[0, 1]], device=device, dtype=dtype
              ),
          )
  
      with pytest.raises(
          Exception,
          match="Length of keys.*does not match number of inputs",
      ):
          f = RandomTransplantation(p=1.0)
          f(image, mask, data_keys=["input", "mask", "mask"])
  
      with pytest.raises(
          Exception,
          match="selected_labels must be a 1-dimensional tensor",
      ):
          params_copy = copy.deepcopy(params)
          params_copy["selected_labels"] = torch.tensor(
              [[0, 1]], device=device, dtype=dtype
          )
          del params_copy["selection"]
          f(image, mask, params=params_copy)
  
      with pytest.raises(
          Exception, match="There cannot be more selected labels"
      ):
          params_copy = copy.deepcopy(params)
          params_copy["selected_labels"] = torch.tensor(
              [0, 1], device=device, dtype=dtype
          )
          del params_copy["selection"]
          f(image, mask, params=params_copy)
  
      with pytest.raises(
          Exception,
          match="Every image input must have one additional dimension",
      ):
          f(image.unsqueeze(dim=-1), mask)
  
      with pytest.raises(
          Exception,
          match="The dimensions of the input image and segmentation mask must match",
      ):
          image = torch.rand(
              1, 3, 2, 5, device=device, dtype=torch.float64
          )
          f(image, mask)
  
imports: import copy
  import pytest
  import torch
  from kornia.augmentation import AugmentationSequential, RandomCutMixV2, RandomJigsaw, RandomMixUpV2, RandomMosaic, RandomTransplantation, RandomTransplantation3D
  from kornia.testing import BaseTester, assert_close, tensor_to_gradcheck_var
label_desc: Use image node_id 10 for calling the TestRandomTransplantation obj's underlying member method code with example usage: obj.test_exception(device, dtype) without return types