code: def svdvals(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      driver: Optional[str] = None,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the singular values of a matrix (or a stack of matrices) ``x``.
  
      Parameters
      ----------
      x
          input array having shape ``(..., M, N)`` and whose innermost two dimensions form
          ``MxN`` matrices.
      driver
          optional output array,name of the cuSOLVER method to be used. This keyword
          argument only works on CUDA inputs.
          Available options are: None, gesvd, gesvdj, and gesvda.Default: None.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          array with shape ``(..., K)`` that contains the vector(s) of singular values of
          length ``K``, where K = min(M, N). The values are sorted in descending order by
          magnitude. The returned array must have a real-valued floating-point data type
          having the same precision as ``x`` (e.g., if ``x`` is ``complex64``,
          the returned array must have a ``float32`` data type).
  
  
      This function conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      extensions/generated/array_api.linalg.svdvals.html>`_
      in the standard.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([[5.0, 7.0], [4.0, 3.0]])
      >>> y = ivy.svdvals(x)
      >>> print(y.shape)
      ivy.Shape(2,)
  
      With comparison of the singular value S ivy.svdvals() by the result ivy.svd().
  
      >>> x = ivy.array([[5.0, 7.0], [4.0, 3.0]])
      >>> _, y, _ = ivy.svd(x)
      >>> print(y.shape)
      ivy.Shape(2,)
  
      >>> x = ivy.array([9.86217213, 1.31816804])
      >>> y = ivy.array([9.86217213, 1.31816804])
      >>> error = (x - y).abs()
      >>> print(error)
      ivy.array([0.,0.])
  
      With :class:`ivy.NativeArray` input:
  
      >>> x = ivy.native_array([[1.0, 2.0, 3.0], [2.0, 3.0, 4.0],
      ...                       [2.0, 1.0, 3.0], [3.0, 4.0, 5.0]])
      >>> print(x.shape)
      (4, 3)
  
      >>> x = ivy.native_array([[1.0, 2.0, 3.0], [2.0, 3.0, 4.0],
      ...                       [2.0, 1.0, 3.0], [3.0, 4.0, 5.0]])
      >>> y = ivy.svdvals(x)
      >>> print(y)
      ivy.array([10.3, 1.16, 0.615])
  
      >>> _, SS, _ = ivy.svd(x)
      >>> print(SS)
      ivy.array([10.3, 1.16, 0.615])
  
      with comparison of singular value S ivy.svdvals() by the result ivy.svd().
  
      >>> x = ivy.array([10.25994301,  1.16403675,  0.61529762])
      >>> y = ivy.array([9.86217213, 1.31816804, 0.51231241])
      >>> error = (x - y).abs()
      >>> print(error)
      ivy.array([0.39777088, 0.15413129, 0.1029852 ])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([[2.0, 3.0], [3.0, 4.0],
      ...                                [1.0, 3.0], [3.0, 5.0]]),
      ...                   b=ivy.array([[7.0, 1.0, 2.0, 3.0],
      ...                                [2.0, 5.0, 3.0, 4.0],
      ...                                [2.0, 6.0, 1.0, 3.0],
      ...                                [3.0, 4.0, 5.0, 9.0]]))
      >>> y = ivy.svdvals(x)
      >>> print(y)
      {
          a: ivy.array([9.01383495, 0.86647356]),
          b: ivy.array([15.7786541, 5.55970621, 4.16857576, 0.86412698])
      }
  
      Instance Method Examples
      ~~~~~~~~~~~~~~~~~~~~~~~~
  
      Using :class:`ivy.Array` instance method:
  
      >>> x = ivy.array([[8.0, 3.0], [2.0, 3.0],
      ...                [2.0, 1.0], [3.0, 4.0],
      ...                [4.0, 1.0], [5.0, 6.0]])
      >>> y = x.svdvals()
      >>> print(y)
      ivy.array([13.37566757,  3.88477993])
  
      With :class:`ivy.Container` instance method:
  
      >>> x = ivy.Container(a=ivy.array([[2.0, 3.0, 6.0], [5.0, 3.0, 4.0],
      ...                                [1.0, 7.0, 3.0], [3.0, 2.0, 5.0]]),
      ...                   b=ivy.array([[7.0, 1.0, 2.0, 3.0, 9.0],
      ...                                [2.0, 5.0, 3.0, 4.0, 10.0],
      ...                                [2.0, 11.0, 6.0, 1.0, 3.0],
      ...                                [8.0, 3.0, 4.0, 5.0, 9.0]]))
      >>> y = x.svdvals()
      >>> print(y)
      {
          a: ivy.array([12.95925522, 4.6444726, 2.54687881]),
          b: ivy.array([23.16134834, 10.35037804, 4.31025076, 1.35769391])
      }
      """
      return current_backend(x).svdvals(x, driver=driver, out=out)
  
imports: from typing import Union, Optional, Tuple, Literal, List, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 21 for calling a global function with example usage: svdvals() and returns: current_backend