def solve(x, y, name=None):
    '\n    Computes the solution of a square system of linear equations with a unique solution for input \'X\' and \'Y\'.\n    Let :math: `X` be a sqaure matrix or a batch of square matrices, :math:`Y` be\n    a vector/matrix or a batch of vectors/matrices, the equation should be:\n\n    .. math::\n        Out = X^-1 * Y\n    Specifically,\n    - This system of linear equations has one solution if and only if input \'X\' is invertible.\n\n    Args:\n        x (Tensor): A square matrix or a batch of square matrices. Its shape should be `[*, M, M]`, where `*` is zero or\n            more batch dimensions. Its data type should be float32 or float64.\n        y (Tensor): A vector/matrix or a batch of vectors/matrices. Its shape should be `[*, M, K]`, where `*` is zero or\n            more batch dimensions. Its data type should be float32 or float64.\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        Tensor: The solution of a square system of linear equations with a unique solution for input \'x\' and \'y\'.\n        Its data type should be the same as that of `x`.\n\n    Examples:\n    .. code-block:: python\n\n        # a square system of linear equations:\n        # 2*X0 + X1 = 9\n        # X0 + 2*X1 = 8\n\n        import paddle\n        import numpy as np\n\n        np_x = np.array([[3, 1],[1, 2]])\n        np_y = np.array([9, 8])\n        x = paddle.to_tensor(np_x, dtype="float64")\n        y = paddle.to_tensor(np_y, dtype="float64")\n        out = paddle.linalg.solve(x, y)\n\n        print(out)\n        # [2., 3.])\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.solve(x, y)
    inputs = {'X': [x], 'Y': [y]}
    helper = LayerHelper('solve', **locals())
    check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'solve')
    check_variable_and_dtype(y, 'y', ['float32', 'float64'], 'solve')
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='solve', inputs={'X': x, 'Y': y}, outputs={'Out': out})
    return out
Computes the solution of a square system of linear equations with a unique solution for input 'X' and 'Y'.
Let :math: `X` be a sqaure matrix or a batch of square matrices, :math:`Y` be
a vector/matrix or a batch of vectors/matrices, the equation should be:

.. math::
    Out = X^-1 * Y
Specifically,
- This system of linear equations has one solution if and only if input 'X' is invertible.

Args:
    x (Tensor): A square matrix or a batch of square matrices. Its shape should be `[*, M, M]`, where `*` is zero or
        more batch dimensions. Its data type should be float32 or float64.
    y (Tensor): A vector/matrix or a batch of vectors/matrices. Its shape should be `[*, M, K]`, where `*` is zero or
        more batch dimensions. Its data type should be float32 or float64.
    name(str, optional): Name for the operation (optional, default is None).
        For more information, please refer to :ref:`api_guide_Name`.

Returns:
    Tensor: The solution of a square system of linear equations with a unique solution for input 'x' and 'y'.
    Its data type should be the same as that of `x`.

Examples:
.. code-block:: python

    # a square system of linear equations:
    # 2*X0 + X1 = 9
    # X0 + 2*X1 = 8

    import paddle
    import numpy as np

    np_x = np.array([[3, 1],[1, 2]])
    np_y = np.array([9, 8])
    x = paddle.to_tensor(np_x, dtype="float64")
    y = paddle.to_tensor(np_y, dtype="float64")
    out = paddle.linalg.solve(x, y)

    print(out)
    # [2., 3.])
def solve(x, y, name=None):
    '\n    Computes the solution of a square system of linear equations with a unique solution for input \'X\' and \'Y\'.\n    Let :math: `X` be a sqaure matrix or a batch of square matrices, :math:`Y` be\n    a vector/matrix or a batch of vectors/matrices, the equation should be:\n\n    .. math::\n        Out = X^-1 * Y\n    Specifically,\n    - This system of linear equations has one solution if and only if input \'X\' is invertible.\n\n    Args:\n        x (Tensor): A square matrix or a batch of square matrices. Its shape should be `[*, M, M]`, where `*` is zero or\n            more batch dimensions. Its data type should be float32 or float64.\n        y (Tensor): A vector/matrix or a batch of vectors/matrices. Its shape should be `[*, M, K]`, where `*` is zero or\n            more batch dimensions. Its data type should be float32 or float64.\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        Tensor: The solution of a square system of linear equations with a unique solution for input \'x\' and \'y\'.\n        Its data type should be the same as that of `x`.\n\n    Examples:\n    .. code-block:: python\n\n        # a square system of linear equations:\n        # 2*X0 + X1 = 9\n        # X0 + 2*X1 = 8\n\n        import paddle\n        import numpy as np\n\n        np_x = np.array([[3, 1],[1, 2]])\n        np_y = np.array([9, 8])\n        x = paddle.to_tensor(np_x, dtype="float64")\n        y = paddle.to_tensor(np_y, dtype="float64")\n        out = paddle.linalg.solve(x, y)\n\n        print(out)\n        # [2., 3.])\n    '
    if paddle.in_dynamic_mode():
        return _C_ops.solve(x, y)
    inputs = {'X': [x], 'Y': [y]}
    helper = LayerHelper('solve', **locals())
    check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'solve')
    check_variable_and_dtype(y, 'y', ['float32', 'float64'], 'solve')
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='solve', inputs={'X': x, 'Y': y}, outputs={'Out': out})
    return out