code: def test_psd_solve_with_chol():
      X = matrix("X")
      X.tag.psd = True
      X_inv = pt.linalg.solve(X, pt.identity_like(X))
  
      f = function([X], X_inv, mode="FAST_RUN")
  
      nodes = f.maker.fgraph.apply_nodes
  
      assert not any(isinstance(node.op, Solve) for node in nodes)
      assert any(isinstance(node.op, Cholesky) for node in nodes)
      assert any(isinstance(node.op, SolveTriangular) for node in nodes)
  
      # Numeric test
      rng = np.random.default_rng(
          sum(map(ord, "test_psd_solve_with_chol"))
      )
  
      L = rng.normal(size=(5, 5)).astype(config.floatX)
      X_psd = L @ L.T
      X_psd_inv = f(X_psd)
      assert_allclose(
          X_psd_inv,
          np.linalg.inv(X_psd),
          atol=1e-4 if config.floatX == "float32" else 1e-8,
          rtol=1e-4 if config.floatX == "float32" else 1e-8,
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import scipy.linalg
  from numpy.testing import assert_allclose
  import pytensor
  from pytensor import function
  from pytensor import tensor
  from pytensor.compile import get_default_mode
  from pytensor.configdefaults import config
  from pytensor.tensor import swapaxes
  from pytensor.tensor.blockwise import Blockwise
  from pytensor.tensor.elemwise import DimShuffle
  from pytensor.tensor.math import _allclose, dot, matmul
  from pytensor.tensor.nlinalg import Det, MatrixInverse, matrix_inverse
  from pytensor.tensor.rewriting.linalg import inv_as_solve
  from pytensor.tensor.slinalg import Cholesky, Solve, SolveBase, SolveTriangular, cho_solve, cholesky, solve, solve_triangular
  from pytensor.tensor.type import dmatrix, matrix, tensor, vector
  from tests import unittest_tools
  from tests.test_rop import break_op
label_desc: Use image node_id 7 for calling a global function with example usage: test_psd_solve_with_chol() without return types