code: def truncated_svd(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      compute_uv: bool = True,
      n_eigenvecs: Optional[int] = None,
  ) -> Union[ivy.Array, Tuple[ivy.Array, ivy.Array, ivy.Array]]:
      """Compute a truncated SVD on `x` using the standard SVD.
  
      Parameters
      ----------
      x
          2D-array
          compute_uv
          If ``True`` then left and right singular vectors will be computed and returned
          in ``U`` and ``Vh``, respectively. Otherwise, only the singular values will be
          computed, which can be significantly faster.
      n_eigenvecs
          if specified, number of eigen[vectors-values] to return
          else full matrices will be returned
  
      Returns
      -------
      ret
          a namedtuple ``(U, S, Vh)``
          Each returned array must have the same floating-point data type as ``x``.
      """
      n_eigenvecs, min_dim, _ = _svd_checks(x, n_eigenvecs=n_eigenvecs)
      full_matrices = True if n_eigenvecs > min_dim else False
  
      if compute_uv:
          U, S, Vh = ivy.svd(
              x, full_matrices=full_matrices, compute_uv=True
          )
          return (
              U[:, :n_eigenvecs],
              S[:n_eigenvecs],
              Vh[:n_eigenvecs, :],
          )
      else:
          S = ivy.svd(x, full_matrices=full_matrices, compute_uv=False)
          return S[:n_eigenvecs]
  
imports: import logging
  from typing import Union, Optional, Tuple, List, Sequence, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, handle_device, inputs_to_ivy_arrays, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 19 for calling a global function with example usage: truncated_svd(compute_uv, n_eigenvecs) and returns: U,  S,  Vh, S