code: def test_tensor_train_cross_2():
      """Test for tensor-train"""
      rng = tl.check_random_state(1234)
  
      ## Test 2
      # Create tensor with random elements
      tensor = tl.tensor(rng.random_sample([3, 4, 5, 6, 2, 10]))
  
      # Find TT decomposition of the tensor
      rank = [1, 2, 2, 3, 2, 2, 1]
      factors = tensor_train_cross(tensor, rank, random_state=rng)
  
      for k in range(6):
          (r_prev, n_k, r_k) = factors[k].shape
  
          first_error_message = (
              "TT rank "
              + str(k)
              + " is greater than the maximum allowed "
          )
          first_error_message += str(r_prev) + " > " + str(rank[k])
          assert r_prev <= rank[k], first_error_message
  
          first_error_message = (
              "TT rank "
              + str(k + 1)
              + " is greater than the maximum allowed "
          )
          first_error_message += str(r_k) + " > " + str(rank[k + 1])
          assert r_k <= rank[k + 1], first_error_message
  
file_path: tensorly/tensorly/contrib/decomposition/tests/test_mps_decomposition_cross.py
imports: import tensorly
  import pytest
  import numpy
  import itertools
  from .._tt_cross import tensor_train_cross
  from ....tt_tensor import tt_to_tensor
  from tensorly.testing import assert_
label_desc: Use image node_id 2 for calling a global function with example usage: test_tensor_train_cross_2() without return types