code: def test_same_on_batch(self, device, dtype):
      torch.manual_seed(42)
      degrees = torch.tensor(
          [[10, 20], [10, 20], [10, 20]], device=device, dtype=dtype
      )
      translate = torch.tensor(
          [0.1, 0.1, 0.1], device=device, dtype=dtype
      )
      scale = torch.tensor(
          [[0.7, 1.2], [0.7, 1.2], [0.7, 1.2]],
          device=device,
          dtype=dtype,
      )
      shear = torch.tensor(
          [[0, 20], [0, 20], [0, 20], [0, 20], [0, 20], [0, 20]],
          device=device,
          dtype=dtype,
      )
  
      param_gen = AffineGenerator3D(
          degrees=degrees,
          translate=translate,
          scale=scale,
          shears=shear,
      )
      res = param_gen(
          batch_shape=torch.Size((2, 200, 200, 200)), same_on_batch=True
      )
  
      expected = {
          "translations": torch.tensor(
              [
                  [-9.7371, 11.7457, 17.6309],
                  [-9.7371, 11.7457, 17.6309],
              ],
              device=device,
              dtype=dtype,
          ),
          "center": torch.tensor(
              [
                  [99.5000, 99.5000, 99.5000],
                  [99.5000, 99.5000, 99.5000],
              ],
              device=device,
              dtype=dtype,
          ),
          "scale": torch.tensor(
              [[1.1797, 0.8952, 1.0004], [1.1797, 0.8952, 1.0004]],
              device=device,
              dtype=dtype,
          ),
          "angles": torch.tensor(
              [
                  [18.8227, 19.1500, 13.8286],
                  [18.8227, 19.1500, 13.8286],
              ],
              device=device,
              dtype=dtype,
          ),
          "sxy": torch.tensor(
              [2.6637, 2.6637], device=device, dtype=dtype
          ),
          "sxz": torch.tensor(
              [18.6920, 18.6920], device=device, dtype=dtype
          ),
          "syx": torch.tensor(
              [11.8716, 11.8716], device=device, dtype=dtype
          ),
          "syz": torch.tensor(
              [17.3881, 17.3881], device=device, dtype=dtype
          ),
          "szx": torch.tensor(
              [11.3543, 11.3543], device=device, dtype=dtype
          ),
          "szy": torch.tensor(
              [14.8219, 14.8219], device=device, dtype=dtype
          ),
      }
      assert res.keys() == expected.keys()
      assert_close(
          res["translations"],
          expected["translations"],
          rtol=1e-4,
          atol=1e-4,
      )
      assert_close(
          res["center"], expected["center"], rtol=1e-4, atol=1e-4
      )
      assert_close(
          res["scale"], expected["scale"], rtol=1e-4, atol=1e-4
      )
      assert_close(
          res["angles"], expected["angles"], rtol=1e-4, atol=1e-4
      )
      assert_close(res["sxy"], expected["sxy"], rtol=1e-4, atol=1e-4)
      assert_close(res["sxz"], expected["sxz"], rtol=1e-4, atol=1e-4)
      assert_close(res["syx"], expected["syx"], rtol=1e-4, atol=1e-4)
      assert_close(res["syz"], expected["syz"], rtol=1e-4, atol=1e-4)
      assert_close(res["szx"], expected["szx"], rtol=1e-4, atol=1e-4)
      assert_close(res["szy"], expected["szy"], rtol=1e-4, atol=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 4 for calling the TestRandomAffineGen3D obj's underlying member method code with example usage: obj.test_same_on_batch(device, dtype) without return types