def eig(x, name=None):
    '\n    This API performs the eigenvalue decomposition of a square matrix or a batch of square matrices.\n\n    .. note::\n        If the matrix is a Hermitian or a real symmetric matrix, please use :ref:`paddle.linalg.eigh` instead, which is much faster.\n        If only eigenvalues is needed, please use :ref:`paddle.linalg.eigvals` instead.\n        If the matrix is of any shape, please use :ref:`paddle.linalg.svd`.\n        This API is only supported on CPU device.\n        The output datatype is always complex for both real and complex input.\n\n    Args:\n        x (Tensor): A tensor with shape math:`[*, N, N]`, The data type of the x should be one of ``float32``,\n            ``float64``, ``compplex64`` or ``complex128``.\n        name (str, optional): The default value is `None`. Normally there is no need for user to set \n            this property. For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n        Eigenvalues(Tensors): A tensor with shape math:`[*, N]` refers to the eigen values.\n        Eigenvectors(Tensors): A tensor with shape math:`[*, N, N]` refers to the eigen vectors.\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n            import numpy as np\n\n            paddle.device.set_device("cpu")\n\n            x_data = np.array([[1.6707249, 7.2249975, 6.5045543],\n                               [9.956216,  8.749598,  6.066444 ],\n                               [4.4251957, 1.7983172, 0.370647 ]]).astype("float32")\n            x = paddle.to_tensor(x_data)\n            w, v = paddle.linalg.eig(x)\n            print(w)\n            # Tensor(shape=[3, 3], dtype=complex128, place=CPUPlace, stop_gradient=False,\n            #       [[(-0.5061363550800655+0j) , (-0.7971760990842826+0j) ,\n            #         (0.18518077798279986+0j)],\n            #        [(-0.8308237755993192+0j) ,  (0.3463813401919749+0j) ,\n            #         (-0.6837005269141947+0j) ],\n            #        [(-0.23142567697893396+0j),  (0.4944999840400175+0j) ,\n            #         (0.7058765252952796+0j) ]])\n\n            print(v)\n            # Tensor(shape=[3], dtype=complex128, place=CPUPlace, stop_gradient=False,\n            #       [ (16.50471283351188+0j)  , (-5.5034820550763515+0j) ,\n            #         (-0.21026087843552282+0j)])\n    '
    if paddle.in_dynamic_mode():
        (w, v) = _C_ops.eig(x)
        return (w, v)
    check_variable_and_dtype(x, 'X', ['float32', 'float64', 'complex64', 'complex128'], 'eig')
    helper = LayerHelper('eig', **locals())
    w = helper.create_variable_for_type_inference(x.dtype)
    v = helper.create_variable_for_type_inference(x.dtype)
    inputs = {'X': x}
    outputs = {'Eigenvalues': w, 'Eigenvectors': v}
    helper.append_op(type='eig', inputs=inputs, outputs=outputs)
    return (w, v)
This API performs the eigenvalue decomposition of a square matrix or a batch of square matrices.

.. note::
    If the matrix is a Hermitian or a real symmetric matrix, please use :ref:`paddle.linalg.eigh` instead, which is much faster.
    If only eigenvalues is needed, please use :ref:`paddle.linalg.eigvals` instead.
    If the matrix is of any shape, please use :ref:`paddle.linalg.svd`.
    This API is only supported on CPU device.
    The output datatype is always complex for both real and complex input.

Args:
    x (Tensor): A tensor with shape math:`[*, N, N]`, The data type of the x should be one of ``float32``,
        ``float64``, ``compplex64`` or ``complex128``.
    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:
    Eigenvalues(Tensors): A tensor with shape math:`[*, N]` refers to the eigen values.
    Eigenvectors(Tensors): A tensor with shape math:`[*, N, N]` refers to the eigen vectors.

Examples:
    .. code-block:: python

        import paddle
        import numpy as np

        paddle.device.set_device("cpu")

        x_data = np.array([[1.6707249, 7.2249975, 6.5045543],
                           [9.956216,  8.749598,  6.066444 ],
                           [4.4251957, 1.7983172, 0.370647 ]]).astype("float32")
        x = paddle.to_tensor(x_data)
        w, v = paddle.linalg.eig(x)
        print(w)
        # Tensor(shape=[3, 3], dtype=complex128, place=CPUPlace, stop_gradient=False,
        #       [[(-0.5061363550800655+0j) , (-0.7971760990842826+0j) ,
        #         (0.18518077798279986+0j)],
        #        [(-0.8308237755993192+0j) ,  (0.3463813401919749+0j) ,
        #         (-0.6837005269141947+0j) ],
        #        [(-0.23142567697893396+0j),  (0.4944999840400175+0j) ,
        #         (0.7058765252952796+0j) ]])

        print(v)
        # Tensor(shape=[3], dtype=complex128, place=CPUPlace, stop_gradient=False,
        #       [ (16.50471283351188+0j)  , (-5.5034820550763515+0j) ,
        #         (-0.21026087843552282+0j)])
def eig(x, name=None):
    '\n    This API performs the eigenvalue decomposition of a square matrix or a batch of square matrices.\n\n    .. note::\n        If the matrix is a Hermitian or a real symmetric matrix, please use :ref:`paddle.linalg.eigh` instead, which is much faster.\n        If only eigenvalues is needed, please use :ref:`paddle.linalg.eigvals` instead.\n        If the matrix is of any shape, please use :ref:`paddle.linalg.svd`.\n        This API is only supported on CPU device.\n        The output datatype is always complex for both real and complex input.\n\n    Args:\n        x (Tensor): A tensor with shape math:`[*, N, N]`, The data type of the x should be one of ``float32``,\n            ``float64``, ``compplex64`` or ``complex128``.\n        name (str, optional): The default value is `None`. Normally there is no need for user to set \n            this property. For more information, please refer to :ref:`api_guide_Name`.\n\n    Returns:\n        Eigenvalues(Tensors): A tensor with shape math:`[*, N]` refers to the eigen values.\n        Eigenvectors(Tensors): A tensor with shape math:`[*, N, N]` refers to the eigen vectors.\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n            import numpy as np\n\n            paddle.device.set_device("cpu")\n\n            x_data = np.array([[1.6707249, 7.2249975, 6.5045543],\n                               [9.956216,  8.749598,  6.066444 ],\n                               [4.4251957, 1.7983172, 0.370647 ]]).astype("float32")\n            x = paddle.to_tensor(x_data)\n            w, v = paddle.linalg.eig(x)\n            print(w)\n            # Tensor(shape=[3, 3], dtype=complex128, place=CPUPlace, stop_gradient=False,\n            #       [[(-0.5061363550800655+0j) , (-0.7971760990842826+0j) ,\n            #         (0.18518077798279986+0j)],\n            #        [(-0.8308237755993192+0j) ,  (0.3463813401919749+0j) ,\n            #         (-0.6837005269141947+0j) ],\n            #        [(-0.23142567697893396+0j),  (0.4944999840400175+0j) ,\n            #         (0.7058765252952796+0j) ]])\n\n            print(v)\n            # Tensor(shape=[3], dtype=complex128, place=CPUPlace, stop_gradient=False,\n            #       [ (16.50471283351188+0j)  , (-5.5034820550763515+0j) ,\n            #         (-0.21026087843552282+0j)])\n    '
    if paddle.in_dynamic_mode():
        (w, v) = _C_ops.eig(x)
        return (w, v)
    check_variable_and_dtype(x, 'X', ['float32', 'float64', 'complex64', 'complex128'], 'eig')
    helper = LayerHelper('eig', **locals())
    w = helper.create_variable_for_type_inference(x.dtype)
    v = helper.create_variable_for_type_inference(x.dtype)
    inputs = {'X': x}
    outputs = {'Eigenvalues': w, 'Eigenvectors': v}
    helper.append_op(type='eig', inputs=inputs, outputs=outputs)
    return (w, v)