code: def test_qr():
      M = 8
      N = 5
      A = T.tensor(np.random.random((M, N)))
      Q, R = T.qr(A)
  
      assert T.shape(Q) == (M, N), "Unexpected shape"
      assert T.shape(R) == (N, N), "Unexpected shape"
  
      # assert that the columns of Q are orthonormal
      Q_column_norms = T.norm(Q, 2, axis=0)
      assert_array_almost_equal(Q_column_norms, T.ones(N))
      for i in range(N):
          for j in range(i):
              dot_product = T.to_numpy(T.dot(Q[:, i], Q[:, j]))
              assert (
                  abs(dot_product) < 1e-6
              ), "Columns of Q not orthogonal"
  
      A_reconstructed = T.dot(Q, R)
      assert_array_almost_equal(A, A_reconstructed)
  
imports: from concurrent.futures import ThreadPoolExecutor
  import pytest
  from time import time
  import numpy
  from scipy.linalg import svd
  from scipy import special
  import tensorly
  from ..None import backend
  from ..testing import assert_allclose, assert_array_equal, assert_equal, assert_, assert_array_almost_equal, assert_raises
  from tensorly.tenalg.svd import SVD_FUNS, svd_interface
label_desc: Use image node_id 16 for calling a global function with example usage: test_qr() without return types