code: def test_get_perspective_transform3d_2(
      self, batch_size, device, dtype
  ):
      torch.manual_seed(0)
      src = kornia.geometry.bbox.bbox_generator3d(
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
      ).to(device=device, dtype=dtype)
      dst = kornia.geometry.bbox.bbox_generator3d(
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint_like(
              torch.ones(batch_size), 0, 50, dtype=dtype
          ),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
          torch.randint(0, 50, (1,), dtype=dtype).repeat(batch_size),
      ).to(device=device, dtype=dtype)
      out = kornia.geometry.transform.get_perspective_transform3d(
          src, dst
      )
      if batch_size == 1:
          expected = torch.tensor(
              [
                  [
                      [3.3000, 0.0000, 0.0000, -118.2000],
                      [0.0000, 0.0769, 0.0000, 0.0000],
                      [0.0000, 0.0000, 0.5517, 28.7930],
                      [0.0000, 0.0000, 0.0000, 1.0000],
                  ]
              ],
              device=device,
              dtype=dtype,
          )
      if batch_size == 2:
          expected = torch.tensor(
              [
                  [
                      [0.9630, 0.0000, 0.0000, -9.3702],
                      [0.0000, 2.0000, 0.0000, -49.9999],
                      [0.0000, 0.0000, 0.3830, 44.0213],
                      [0.0000, 0.0000, 0.0000, 1.0000],
                  ],
                  [
                      [0.9630, 0.0000, 0.0000, -36.5555],
                      [0.0000, 2.0000, 0.0000, -14.0000],
                      [0.0000, 0.0000, 0.3830, 16.8940],
                      [0.0000, 0.0000, 0.0000, 1.0000],
                  ],
              ],
              device=device,
              dtype=dtype,
          )
  
      assert_close(out, expected, rtol=1e-4, atol=1e-4)
  
      # compute gradient check
      points_src = utils.tensor_to_gradcheck_var(src)  # to var
      points_dst = utils.tensor_to_gradcheck_var(dst)  # to var
      assert gradcheck(
          kornia.geometry.transform.get_perspective_transform3d,
          (points_src, points_dst),
          raise_exception=True,
          fast_mode=True,
      )
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.geometry.transform
  import kornia.testing
  from kornia.testing import assert_close
  from kornia.utils.helpers import _torch_inverse_cast
label_desc: Use image node_id 2 for calling the TestPerspectiveTransform3D obj's underlying member method code with example usage: obj.test_get_perspective_transform3d_2(batch_size, device, dtype) without return types