def svd(x, full_matrices=False, name=None):
    "\n    Computes the singular value decomposition of one matrix or a batch of regular matrices.\n\n    Let :math:`X` be the input matrix or a batch of input matrices, the output should satisfies:\n\n    .. math::\n        X = U * diag(S) * VT\n\n    Args:\n        x (Tensor): The input tensor. Its shape should be `[..., N, M]`,\n            where `...` is zero or more batch dimensions. N and M can be arbitraty\n            positive number. Note that if x is sigular matrices, the grad is numerical\n            instable. The data type of x should be float32 or float64.\n        full_matrices (bool): A flag to control the behavor of svd.\n            If full_matrices = True, svd op will compute full U and V matrics,\n            which means shape of U is `[..., N, N]`, shape of V is `[..., M, M]`. K = min(M, N).\n            If full_matrices = False, svd op will use a economic method to store U and V.\n            which means shape of U is `[..., N, K]`, shape of V is `[..., M, K]`. K = min(M, N).\n        name (str, optional): Name for the operation (optional, default is None).\n            For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n        Tuple of 3 tensors: (U, S, VH). VH is the conjugate transpose of V. S is the singlar value vectors of matrics with shape `[..., K]`\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            x = paddle.to_tensor([[1.0, 2.0], [1.0, 3.0], [4.0, 6.0]]).astype('float64')\n            x = x.reshape([3, 2])\n            u, s, vh = paddle.linalg.svd(x)\n            print (u)\n            #U = [[ 0.27364809, -0.21695147  ],\n            #      [ 0.37892198, -0.87112408 ],\n            #      [ 0.8840446 ,  0.44053933 ]]\n\n            print (s)\n            #S = [8.14753743, 0.78589688]\n            print (vh)\n            #VT= [[ 0.51411221,  0.85772294],\n            #     [ 0.85772294, -0.51411221]]\n\n            # one can verify : U * S * VT == X\n            #                  U * UH == I\n            #                  V * VH == I\n    "
    if paddle.in_dynamic_mode():
        return _C_ops.svd(x, 'full_matrices', full_matrices)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'svd')
    check_type(full_matrices, 'full_matrices', bool, 'svd')
    helper = LayerHelper('svd', **locals())
    u = helper.create_variable_for_type_inference(dtype=x.dtype)
    vh = helper.create_variable_for_type_inference(dtype=x.dtype)
    s = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['full_matrices'] = full_matrices
    helper.append_op(type='svd', inputs={'X': [x]}, outputs={'U': u, 'VH': vh, 'S': s}, attrs=attrs)
    return (u, s, vh)
Computes the singular value decomposition of one matrix or a batch of regular matrices.

Let :math:`X` be the input matrix or a batch of input matrices, the output should satisfies:

.. math::
    X = U * diag(S) * VT

Args:
    x (Tensor): The input tensor. Its shape should be `[..., N, M]`,
        where `...` is zero or more batch dimensions. N and M can be arbitraty
        positive number. Note that if x is sigular matrices, the grad is numerical
        instable. The data type of x should be float32 or float64.
    full_matrices (bool): A flag to control the behavor of svd.
        If full_matrices = True, svd op will compute full U and V matrics,
        which means shape of U is `[..., N, N]`, shape of V is `[..., M, M]`. K = min(M, N).
        If full_matrices = False, svd op will use a economic method to store U and V.
        which means shape of U is `[..., N, K]`, shape of V is `[..., M, K]`. K = min(M, N).
    name (str, optional): Name for the operation (optional, default is None).
        For more information, please refer to :ref:`api_guide_Name`.

Returns:
    Tuple of 3 tensors: (U, S, VH). VH is the conjugate transpose of V. S is the singlar value vectors of matrics with shape `[..., K]`

Examples:
    .. code-block:: python

        import paddle

        x = paddle.to_tensor([[1.0, 2.0], [1.0, 3.0], [4.0, 6.0]]).astype('float64')
        x = x.reshape([3, 2])
        u, s, vh = paddle.linalg.svd(x)
        print (u)
        #U = [[ 0.27364809, -0.21695147  ],
        #      [ 0.37892198, -0.87112408 ],
        #      [ 0.8840446 ,  0.44053933 ]]

        print (s)
        #S = [8.14753743, 0.78589688]
        print (vh)
        #VT= [[ 0.51411221,  0.85772294],
        #     [ 0.85772294, -0.51411221]]

        # one can verify : U * S * VT == X
        #                  U * UH == I
        #                  V * VH == I
def svd(x, full_matrices=False, name=None):
    "\n    Computes the singular value decomposition of one matrix or a batch of regular matrices.\n\n    Let :math:`X` be the input matrix or a batch of input matrices, the output should satisfies:\n\n    .. math::\n        X = U * diag(S) * VT\n\n    Args:\n        x (Tensor): The input tensor. Its shape should be `[..., N, M]`,\n            where `...` is zero or more batch dimensions. N and M can be arbitraty\n            positive number. Note that if x is sigular matrices, the grad is numerical\n            instable. The data type of x should be float32 or float64.\n        full_matrices (bool): A flag to control the behavor of svd.\n            If full_matrices = True, svd op will compute full U and V matrics,\n            which means shape of U is `[..., N, N]`, shape of V is `[..., M, M]`. K = min(M, N).\n            If full_matrices = False, svd op will use a economic method to store U and V.\n            which means shape of U is `[..., N, K]`, shape of V is `[..., M, K]`. K = min(M, N).\n        name (str, optional): Name for the operation (optional, default is None).\n            For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n        Tuple of 3 tensors: (U, S, VH). VH is the conjugate transpose of V. S is the singlar value vectors of matrics with shape `[..., K]`\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            x = paddle.to_tensor([[1.0, 2.0], [1.0, 3.0], [4.0, 6.0]]).astype('float64')\n            x = x.reshape([3, 2])\n            u, s, vh = paddle.linalg.svd(x)\n            print (u)\n            #U = [[ 0.27364809, -0.21695147  ],\n            #      [ 0.37892198, -0.87112408 ],\n            #      [ 0.8840446 ,  0.44053933 ]]\n\n            print (s)\n            #S = [8.14753743, 0.78589688]\n            print (vh)\n            #VT= [[ 0.51411221,  0.85772294],\n            #     [ 0.85772294, -0.51411221]]\n\n            # one can verify : U * S * VT == X\n            #                  U * UH == I\n            #                  V * VH == I\n    "
    if paddle.in_dynamic_mode():
        return _C_ops.svd(x, 'full_matrices', full_matrices)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'svd')
    check_type(full_matrices, 'full_matrices', bool, 'svd')
    helper = LayerHelper('svd', **locals())
    u = helper.create_variable_for_type_inference(dtype=x.dtype)
    vh = helper.create_variable_for_type_inference(dtype=x.dtype)
    s = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['full_matrices'] = full_matrices
    helper.append_op(type='svd', inputs={'X': [x]}, outputs={'U': u, 'VH': vh, 'S': s}, attrs=attrs)
    return (u, s, vh)