docstr: Tests that converting a matrix to intrinsics and back is consistent.
docstr_tok: ["Tests","that","converting","a","matrix","to","intrinsics","and","back","is","consistent","."]
code: def test_matrix_from_intrinsics_to_matrix_random(self):
      """Tests that converting a matrix to intrinsics and back is consistent."""
      tensor_size = np.random.randint(3)
      tensor_shape = np.random.randint(
          1, 10, size=(tensor_size)
      ).tolist()
      random_focal = np.random.normal(size=tensor_shape + [2])
      random_principal_point = np.random.normal(size=tensor_shape + [2])
      fx = random_focal[..., 0]
      fy = random_focal[..., 1]
      cx = random_principal_point[..., 0]
      cy = random_principal_point[..., 1]
      zero = np.zeros_like(fx)
      one = np.ones_like(fx)
      random_matrix = np.stack(
          (fx, zero, cx, zero, fy, cy, zero, zero, one), axis=-1
      ).reshape(tensor_shape + [3, 3])
  
      (
          focal,
          principal_point,
          skew_coefficient,
      ) = perspective.intrinsics_from_matrix(random_matrix)
      matrix = perspective.matrix_from_intrinsics(
          focal, principal_point, skew_coefficient
      )
  
      self.assertAllClose(random_matrix, matrix, rtol=1e-3)
  
imports: import math
  import sys
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.rendering.camera import perspective
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 19 for calling the PerspectiveTest obj's underlying member method code with example usage: obj.test_matrix_from_intrinsics_to_matrix_random() without return types