code: def test_random_gen(self, device, dtype):
      torch.manual_seed(42)
      batch_size = 2
  
      param_gen = PerspectiveGenerator3D(
          distortion_scale=torch.tensor(0.5, device=device, dtype=dtype)
      )
      res = param_gen(
          batch_shape=torch.Size((batch_size, 200, 200, 200))
      )
  
      expected = {
          "start_points": torch.tensor(
              [
                  [
                      [0.0, 0.0, 0.0],
                      [199.0, 0.0, 0.0],
                      [199.0, 199.0, 0.0],
                      [0.0, 199.0, 0.0],
                      [0.0, 0.0, 199.0],
                      [199.0, 0.0, 199.0],
                      [199.0, 199.0, 199.0],
                      [0.0, 199.0, 199.0],
                  ],
                  [
                      [0.0, 0.0, 0.0],
                      [199.0, 0.0, 0.0],
                      [199.0, 199.0, 0.0],
                      [0.0, 199.0, 0.0],
                      [0.0, 0.0, 199.0],
                      [199.0, 0.0, 199.0],
                      [199.0, 199.0, 199.0],
                      [0.0, 199.0, 199.0],
                  ],
              ],
              device=device,
              dtype=dtype,
          ),
          "end_points": torch.tensor(
              [
                  [
                      [44.1135, 45.7502, 19.1432],
                      [151.0347, 19.5224, 30.0448],
                      [186.1714, 159.3179, 47.0386],
                      [6.6593, 152.2701, 29.6790],
                      [43.4702, 28.3858, 161.9453],
                      [177.5298, 44.2721, 170.3048],
                      [185.6710, 167.6275, 185.5184],
                      [22.0682, 184.1540, 157.4157],
                  ],
                  [
                      [5.2657, 13.4747, 17.9406],
                      [189.0318, 27.3596, 0.3080],
                      [151.4223, 195.2367, 44.3007],
                      [29.1605, 182.1176, 40.4487],
                      [28.8963, 45.1991, 171.2670],
                      [181.8843, 31.7171, 180.7795],
                      [163.4786, 151.6794, 159.5485],
                      [14.0707, 159.5684, 169.5268],
                  ],
              ],
              device=device,
              dtype=dtype,
          ),
      }
      assert res.keys() == expected.keys()
      assert_close(
          res["start_points"],
          expected["start_points"],
          atol=1e-4,
          rtol=1e-4,
      )
      assert_close(
          res["end_points"],
          expected["end_points"],
          atol=1e-4,
          rtol=1e-4,
      )
  
imports: import pytest
  import torch
  from kornia.augmentation.random_generator import AffineGenerator3D, CropGenerator3D, MotionBlurGenerator3D, PerspectiveGenerator3D, RotationGenerator3D, center_crop_generator3d
  from kornia.testing import assert_close
label_desc: Use image node_id 3 for calling the TestRandomPerspectiveGen3D obj's underlying member method code with example usage: obj.test_random_gen(device, dtype) without return types