def eigh(x, UPLO='L', name=None):
    '\n    Compute the eigenvalues and eigenvectors of a\n    complex Hermitian (conjugate symmetric) or a real symmetric matrix.\n\n    Args:\n        x (Tensor): A tensor with shape :math:`[*, N, N]` , The data type of the input Tensor x\n            should be one of float32, float64, complex64, complex128.\n        UPLO(str, optional): (string, default \'L\'), \'L\' represents the lower triangular matrix,\n                        "\'U\' represents the upper triangular matrix.".\n        name(str, optional): The default value is None.  Normally there is no need for user to set this\n            property.  For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n\n        out_value(Tensor):  A Tensor with shape [*, N] and data type of float32 and float64. The eigenvalues of eigh op.\n        out_vector(Tensor): A Tensor with shape [*, N, N] and data type of float32,float64,complex64 and complex128. The eigenvectors of eigh op.\n\n    Examples:\n        .. code-block:: python\n\n            import numpy as np\n            import paddle\n\n            x_data = np.array([[1, -2j], [2j, 5]])\n            x = paddle.to_tensor(x_data)\n            out_value, out_vector = paddle.linalg.eigh(x, UPLO=\'L\')\n            print(out_value)\n            #[0.17157288, 5.82842712]\n            print(out_vector)\n            #[(-0.9238795325112867+0j), (-0.3826834323650898+0j)],\n            #[ 0.3826834323650898j    , -0.9238795325112867j    ]]\n\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.eigh(x, 'UPLO', UPLO)

    def __check_input(x, UPLO):
        x_shape = list(x.shape)
        if (len(x.shape) < 2):
            raise ValueError(('Input(input) only support >=2 tensor, but received length of Input(input) is %s.' % len(x.shape)))
        if (x_shape[(- 1)] != x_shape[(- 2)]):
            raise ValueError("The input matrix must be batches of square matrices. But received x's dimention: {}".format(x_shape))
        if ((UPLO != 'L') and (UPLO != 'U')):
            raise ValueError('UPLO must be L or U. But received UPLO is: {}'.format(UPLO))
    __check_input(x, UPLO)
    helper = LayerHelper('eigh', **locals())
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64', 'complex64', 'complex128'], 'eigh')
    out_value = helper.create_variable_for_type_inference(dtype=x.dtype)
    out_vector = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='eigh', inputs={'X': x}, outputs={'Eigenvalues': out_value, 'Eigenvectors': out_vector}, attrs={'UPLO': UPLO})
    return (out_value, out_vector)
Compute the eigenvalues and eigenvectors of a
complex Hermitian (conjugate symmetric) or a real symmetric matrix.

Args:
    x (Tensor): A tensor with shape :math:`[*, N, N]` , The data type of the input Tensor x
        should be one of float32, float64, complex64, complex128.
    UPLO(str, optional): (string, default 'L'), 'L' represents the lower triangular matrix,
                    "'U' represents the upper triangular matrix.".
    name(str, optional): The default value is None.  Normally there is no need for user to set this
        property.  For more information, please refer to :ref:`api_guide_Name`.

Returns:

    out_value(Tensor):  A Tensor with shape [*, N] and data type of float32 and float64. The eigenvalues of eigh op.
    out_vector(Tensor): A Tensor with shape [*, N, N] and data type of float32,float64,complex64 and complex128. The eigenvectors of eigh op.

Examples:
    .. code-block:: python

        import numpy as np
        import paddle

        x_data = np.array([[1, -2j], [2j, 5]])
        x = paddle.to_tensor(x_data)
        out_value, out_vector = paddle.linalg.eigh(x, UPLO='L')
        print(out_value)
        #[0.17157288, 5.82842712]
        print(out_vector)
        #[(-0.9238795325112867+0j), (-0.3826834323650898+0j)],
        #[ 0.3826834323650898j    , -0.9238795325112867j    ]]
def eigh(x, UPLO='L', name=None):
    '\n    Compute the eigenvalues and eigenvectors of a\n    complex Hermitian (conjugate symmetric) or a real symmetric matrix.\n\n    Args:\n        x (Tensor): A tensor with shape :math:`[*, N, N]` , The data type of the input Tensor x\n            should be one of float32, float64, complex64, complex128.\n        UPLO(str, optional): (string, default \'L\'), \'L\' represents the lower triangular matrix,\n                        "\'U\' represents the upper triangular matrix.".\n        name(str, optional): The default value is None.  Normally there is no need for user to set this\n            property.  For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n\n        out_value(Tensor):  A Tensor with shape [*, N] and data type of float32 and float64. The eigenvalues of eigh op.\n        out_vector(Tensor): A Tensor with shape [*, N, N] and data type of float32,float64,complex64 and complex128. The eigenvectors of eigh op.\n\n    Examples:\n        .. code-block:: python\n\n            import numpy as np\n            import paddle\n\n            x_data = np.array([[1, -2j], [2j, 5]])\n            x = paddle.to_tensor(x_data)\n            out_value, out_vector = paddle.linalg.eigh(x, UPLO=\'L\')\n            print(out_value)\n            #[0.17157288, 5.82842712]\n            print(out_vector)\n            #[(-0.9238795325112867+0j), (-0.3826834323650898+0j)],\n            #[ 0.3826834323650898j    , -0.9238795325112867j    ]]\n\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.eigh(x, 'UPLO', UPLO)

    def __check_input(x, UPLO):
        x_shape = list(x.shape)
        if (len(x.shape) < 2):
            raise ValueError(('Input(input) only support >=2 tensor, but received length of Input(input) is %s.' % len(x.shape)))
        if (x_shape[(- 1)] != x_shape[(- 2)]):
            raise ValueError("The input matrix must be batches of square matrices. But received x's dimention: {}".format(x_shape))
        if ((UPLO != 'L') and (UPLO != 'U')):
            raise ValueError('UPLO must be L or U. But received UPLO is: {}'.format(UPLO))
    __check_input(x, UPLO)
    helper = LayerHelper('eigh', **locals())
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64', 'complex64', 'complex128'], 'eigh')
    out_value = helper.create_variable_for_type_inference(dtype=x.dtype)
    out_vector = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='eigh', inputs={'X': x}, outputs={'Eigenvalues': out_value, 'Eigenvectors': out_vector}, attrs={'UPLO': UPLO})
    return (out_value, out_vector)