code: def test_validate_tt_tensor(true_shape, true_rank):
      factors = ivy.random_tt(true_shape, true_rank).factors
      shape, rank = ivy.TTTensor.validate_tt_tensor(factors)
  
      np.testing.assert_equal(
          shape,
          true_shape,
          err_msg=f"Returned incorrect shape (got {shape}, expected {true_shape})",
      )
      np.testing.assert_equal(
          rank,
          true_rank,
          err_msg=f"Returned incorrect rank (got {rank}, expected {true_rank})",
      )
  
      factors[0] = ivy.random_uniform(shape=(4, 4))
      with np.testing.assert_raises(ValueError):
          ivy.TTTensor.validate_tt_tensor(factors)
  
      factors[0] = ivy.random_uniform(shape=(3, 3, 2))
      with np.testing.assert_raises(ValueError):
          ivy.TTTensor.validate_tt_tensor(factors)
  
file_path: ivy/ivy_tests/test_ivy/test_misc/test_factorized_tensor/test_tt_tensor.py
imports: import ivy
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_validate_tt_tensor(true_shape, true_rank) without return types