code: def test_qr_modes():
      rng = np.random.default_rng(utt.fetch_seed())
  
      A = matrix("A", dtype=config.floatX)
      a = rng.random((4, 4)).astype(config.floatX)
  
      f = function([A], qr(A))
      t_qr = f(a)
      n_qr = np.linalg.qr(a)
      assert _allclose(n_qr, t_qr)
  
      for mode in ["reduced", "r", "raw"]:
          f = function([A], qr(A, mode))
          t_qr = f(a)
          n_qr = np.linalg.qr(a, mode)
          if isinstance(n_qr, (list, tuple)):
              assert _allclose(n_qr[0], t_qr[0])
              assert _allclose(n_qr[1], t_qr[1])
          else:
              assert _allclose(n_qr, t_qr)
  
      try:
          n_qr = np.linalg.qr(a, "complete")
          f = function([A], qr(A, "complete"))
          t_qr = f(a)
          assert _allclose(n_qr, t_qr)
      except TypeError as e:
          assert "name 'complete' is not defined" in str(e)
  
imports: import numpy
  import numpy.linalg
  import pytest
  from numpy import inf
  from numpy.testing import assert_array_almost_equal
  import pytensor
  from pytensor import function
  from pytensor.configdefaults import config
  from pytensor.tensor.math import _allclose
  from pytensor.tensor.nlinalg import SVD, Eig, MatrixInverse, TensorInv, det, eig, eigh, lstsq, matrix_dot, matrix_inverse, matrix_power, norm, pinv, qr, slogdet, svd, tensorinv, tensorsolve, trace
  from pytensor.tensor.type import lmatrix, lscalar, matrix, scalar, tensor3, tensor4, vector
  from tests import unittest_tools
label_desc: Use image node_id 4 for calling a global function with example usage: test_qr_modes() without return types