code: def test_random_tr(
      *,
      data,
      test_flags,
      backend_fw,
      fn_name,
      on_device,
  ):
      shape, rank, dtype, full, seed = data
      results = helpers.test_function(
          input_dtypes=[],
          backend_to_test=backend_fw,
          test_flags=test_flags,
          on_device=on_device,
          fn_name=fn_name,
          shape=shape,
          rank=rank,
          dtype=dtype,
          full=full,
          seed=seed,
          test_values=False,
      )
  
      ret_np, ret_from_gt_np = results
  
      if full:
          reconstructed_tensor = helpers.flatten_and_to_np(
              ret=ret_np, backend=backend_fw
          )
          reconstructed_tensor_gt = helpers.flatten_and_to_np(
              ret=ret_from_gt_np,
              backend=test_flags.ground_truth_backend,
          )
          for x, x_gt in zip(
              reconstructed_tensor, reconstructed_tensor_gt
          ):
              assert np.prod(shape) == np.prod(x.shape)
              assert np.prod(shape) == np.prod(x_gt.shape)
  
      else:
          core = helpers.flatten_and_to_np(
              ret=ret_np[0], backend=backend_fw
          )
          factors = helpers.flatten_and_to_np(
              ret=ret_np[1], backend=backend_fw
          )
          core_gt = helpers.flatten_and_to_np(
              ret=ret_from_gt_np[0],
              backend=test_flags.ground_truth_backend,
          )
          factors_gt = helpers.flatten_and_to_np(
              ret=ret_from_gt_np[1],
              backend=test_flags.ground_truth_backend,
          )
  
          for c, c_gt in zip(core, core_gt):
              assert len(c) == rank
              assert len(c_gt) == rank
  
          for f, f_gt in zip(factors, factors_gt):
              assert np.prod(f.shape) == np.prod(f_gt.shape)
  
imports: import pytest
  from hypothesis import strategies
  import numpy
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test
label_desc: Use image node_id 18 for calling a global function with example usage: test_random_tr() without return types