code: def test_validate_tucker_tensor(true_shape, true_rank):
      core, factors = ivy.random_tucker(true_shape, true_rank)
  
      # Check shape and rank returned
      shape, rank = ivy.TuckerTensor.validate_tucker_tensor(
          (core, 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})",
      )
  
      # One of the factors has the wrong rank
      factors[0], copy = ivy.random_uniform(shape=((4, 4))), factors[0]
      with np.testing.assert_raises(ValueError):
          ivy.TuckerTensor.validate_tucker_tensor((core, factors))
  
      # Not enough factors to match core
      factors[0] = copy
      with np.testing.assert_raises(ValueError):
          ivy.TuckerTensor.validate_tucker_tensor((core, factors[1:]))
  
      # Not enough factors
      with np.testing.assert_raises(ValueError):
          ivy.TuckerTensor.validate_tucker_tensor((core, factors[:1]))
  
file_path: ivy/ivy_tests/test_ivy/test_misc/test_factorized_tensor/test_tucker_tensor.py
imports: import ivy
  import numpy
  import pytest
label_desc: Use image node_id 9 for calling a global function with example usage: test_validate_tucker_tensor(true_shape, true_rank) without return types