code: def test_cardinality(
      self,
      input_shape_image,
      input_shape_mask,
      target_shape_image,
      device,
      dtype,
  ):
      torch.manual_seed(22)
      image = torch.rand(input_shape_image, device=device, dtype=dtype)
      mask = torch.randint(
          0, 2, input_shape_mask, device=device, dtype=dtype
      )
  
      f = RandomTransplantation(p=1)
      image_out, mask_out = f(image, mask)
  
      assert image_out.shape == target_shape_image
      assert mask_out.shape == torch.Size(
          [s for i, s in enumerate(target_shape_image) if i != 1]
      )
  
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 8 for calling the TestRandomTransplantation obj's underlying member method code with example usage: obj.test_cardinality(input_shape_image, input_shape_mask, target_shape_image, device, dtype) without return types