code: def test_truncated_svd(
      *, data, test_flags, backend_fw, fn_name, on_device
  ):
      input_dtype, x, uv, n_eigenvecs = data
      results = helpers.test_function(
          backend_to_test=backend_fw,
          test_flags=test_flags,
          fn_name=fn_name,
          on_device=on_device,
          input_dtypes=input_dtype,
          x=x,
          compute_uv=uv,
          n_eigenvecs=n_eigenvecs,
          test_values=False,
          return_flat_np_arrays=True,
      )
  
      if results is None:
          return
  
      # value test based on recreating the original matrix and testing the consistency
      ret_flat_np, ret_from_gt_flat_np = results
  
      if uv:
          for i in range(len(ret_flat_np) // 3):
              U = ret_flat_np[i]
              S = ret_flat_np[len(ret_flat_np) // 3 + i]
              Vh = ret_flat_np[2 * len(ret_flat_np) // 3 + i]
          m = U.shape[-1]
          n = Vh.shape[-1]
          S = np.expand_dims(S, -2) if m > n else np.expand_dims(S, -1)
  
          for i in range(len(ret_from_gt_flat_np) // 3):
              U_gt = ret_from_gt_flat_np[i]
              S_gt = ret_from_gt_flat_np[
                  len(ret_from_gt_flat_np) // 3 + i
              ]
              Vh_gt = ret_from_gt_flat_np[
                  2 * len(ret_from_gt_flat_np) // 3 + i
              ]
          S_gt = (
              np.expand_dims(S_gt, -2)
              if m > n
              else np.expand_dims(S_gt, -1)
          )
  
          with BackendHandler.update_backend("numpy") as ivy_backend:
              S_mat = (
                  S
                  * ivy_backend.eye(
                      U.shape[-1],
                      Vh.shape[-2],
                      batch_shape=U.shape[:-2],
                  ).data
              )
              S_mat_gt = (
                  S_gt
                  * ivy_backend.eye(
                      U_gt.shape[-1],
                      Vh_gt.shape[-2],
                      batch_shape=U_gt.shape[:-2],
                  ).data
              )
          reconstructed = np.matmul(np.matmul(U, S_mat), Vh)
          reconstructed_gt = np.matmul(np.matmul(U_gt, S_mat_gt), Vh_gt)
  
          # value test
          helpers.assert_all_close(
              reconstructed,
              reconstructed_gt,
              atol=1e-04,
              backend=backend_fw,
              ground_truth_backend=test_flags.ground_truth_backend,
          )
      else:
          S = ret_flat_np
          S_gt = ret_from_gt_flat_np
          helpers.assert_all_close(
              S[0],
              S_gt[0],
              atol=1e-04,
              backend=backend_fw,
              ground_truth_backend=test_flags.ground_truth_backend,
          )
  
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 55 for calling a global function with example usage: test_truncated_svd() without return types