code: def svd(a):
      r"""
      Singular Value Decomposition.
  
      When `a` is a 2D array, it is factorized as ``ut @ np.diag(s) @ v``,
      where `ut` and `v` are 2D orthonormal arrays and `s` is a 1D
      array of `a`'s singular values. When `a` is higher-dimensional, SVD is
      applied in stacked mode as explained below.
  
      Parameters
      ----------
      a : (..., M, N) ndarray
          A real array with ``a.ndim >= 2`` and ``M <= N``.
  
      Returns
      -------
      ut: (..., M, M) ndarray
          Orthonormal array(s). The first ``a.ndim - 2`` dimensions have the same
          size as those of the input `a`.
      s : (..., M) ndarray
          Vector(s) with the singular values, within each vector sorted in
          descending order. The first ``a.ndim - 2`` dimensions have the same
          size as those of the input `a`.
      v : (..., M, N) ndarray
          Orthonormal array(s). The first ``a.ndim - 2`` dimensions have the same
          size as those of the input `a`.
  
      Notes
      -----
  
      The decomposition is performed using LAPACK routine ``_gesvd``.
  
      SVD is usually described for the factorization of a 2D matrix :math:`A`.
      The higher-dimensional case will be discussed below. In the 2D case, SVD is
      written as :math:`A = U^T S V`, where :math:`A = a`, :math:`U^T = ut`,
      :math:`S= \mathtt{np.diag}(s)` and :math:`V = v`. The 1D array `s`
      contains the singular values of `a` and `ut` and `v` are orthonormal. The rows
      of `v` are the eigenvectors of :math:`A^T A` and the columns of `ut` are
      the eigenvectors of :math:`A A^T`. In both cases the corresponding
      (possibly non-zero) eigenvalues are given by ``s**2``.
  
      The sign of rows of `u` and `v` are determined as described in
      `Auto-Differentiating Linear Algebra <https://arxiv.org/pdf/1710.08717.pdf>`_.
  
      If `a` has more than two dimensions, then broadcasting rules apply.
      This means that SVD is working in "stacked" mode: it iterates over
      all indices of the first ``a.ndim - 2`` dimensions and for each
      combination SVD is applied to the last two indices. The matrix `a`
      can be reconstructed from the decomposition with either
      ``(ut * s[..., None, :]) @ v`` or
      ``ut @ (s[..., None] * v)``. (The ``@`` operator denotes batch matrix multiplication)
  
      This function differs from the original `numpy.linalg.svd
      <https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.svd.html>`_ in
      the following way(s):
       - The sign of rows of `u` and `v` may differ.
       - Does not support complex input.
  
      Examples
      --------
      >>> a = np.arange(54).reshape(6, 9)
      >>> ut, s, v = np.linalg.svd(a)
      >>> ut.shape, s.shape, v.shape
      ((6, 6), (6,), (6, 9))
      >>> s = s.reshape(6, 1)
      >>> ret = np.dot(ut, s * v)
      >>> (ret - a > 1e-3).sum()
      array(0.)
      >>> (ret - a < -1e-3).sum()
      array(0.)
      """
      return tuple(_api_internal.svd(a))
  
file_path: mxnet/python/mxnet/ndarray/numpy/linalg.py
imports: import numpy
  from .None import _op
  from .None import _api_internal
label_desc: Use image node_id 5 for calling a global function with example usage: svd(a) and returns: tuple