code: def test_matrix(self, device, dtype, batch_size):
      params, image_size = self._make_rand_data(
          batch_size, device, dtype
      )
      cam = CameraModel(image_size, CameraModelType.PINHOLE, params)
      z = torch.zeros(batch_size, dtype=dtype, device=device)
      o = torch.ones(batch_size, dtype=dtype, device=device)
      K = torch.stack(
          [
              params[:, 0],
              z,
              params[:, 2],
              z,
              params[:, 1],
              params[:, 3],
              z,
              z,
              o,
          ],
          dim=1,
      ).reshape(batch_size, 3, 3)
      self.assert_close(cam.matrix(), K)
  
file_path: kornia/test/sensors/camera/test_camera_model.py
imports: import pytest
  import torch
  from kornia.geometry.vector import Vector3
  from kornia.image import ImageSize
  from kornia.sensors.camera import CameraModel, CameraModelType
  from kornia.testing import BaseTester
label_desc: Use image node_id 9 for calling the TestPinholeCamera obj's underlying member method code with example usage: obj.test_matrix(device, dtype, batch_size) without return types