code: def test_tensor_train_tensorly_1(shape, rank):
      tensor = ivy.random_uniform(shape=shape)
      tensor_shape = tensor.shape
      factors = ivy.tensor_train(tensor, rank)
  
      assert (
          len(factors) == 6
      ), "Number of factors should be 6, currently has " + str(
          len(factors)
      )
  
      r_prev_iteration = 1
      for k in range(6):
          (r_prev_k, n_k, r_k) = factors[k].shape
          assert tensor_shape[k] == n_k, (
              "Mode 1 of factor "
              + str(k)
              + "needs "
              + str(tensor_shape[k])
              + " dimensions, currently has "
              + str(n_k)
          )
          assert (
              r_prev_k == r_prev_iteration
          ), " Incorrect ranks of factors "
          r_prev_iteration = r_k
  
imports: import math
  from hypothesis import strategies
  from hypothesis import assume
  import numpy
  import pytest
  import itertools
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
  import ivy
label_desc: Use image node_id 52 for calling a global function with example usage: test_tensor_train_tensorly_1(shape, rank) without return types