def qr(x, mode='reduced', name=None):
    '\n    Computes the QR decomposition of one matrix or batches of matrice (backward is unsupported now).\n\n    Args:\n        x (Tensor): The input tensor. Its shape should be `[..., M, N]`,\n            where ... is zero or more batch dimensions. M and N can be arbitrary\n            positive number. The data type of x should be float32 or float64. \n        mode (str, optional): A flag to control the behavior of qr, the default is "reduced". \n            Suppose x\'s shape is `[..., M, N]` and denoting `K = min(M, N)`:\n            If mode = "reduced", qr op will return reduced Q and R matrices, \n            which means Q\'s shape is `[..., M, K]` and R\'s shape is `[..., K, N]`.\n            If mode = "complete", qr op will return complete Q and R matrices, \n            which means Q\'s shape is `[..., M, M]` and R\'s shape is `[..., M, N]`.\n            If mode = "r", qr op will only return reduced R matrix, which means\n            R\'s shape is `[..., K, 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        If mode = "reduced" or mode = "complete", qr will return a two tensor-tuple, which represents Q and R. \n        If mode = "r", qr will return a tensor which represents R.\n        \n    Examples:            \n        .. code-block:: python\n\n            import paddle \n\n            x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype(\'float64\')\n            q, r = paddle.linalg.qr(x)\n            print (q)\n            print (r)\n\n            # Q = [[-0.16903085,  0.89708523],\n            #      [-0.50709255,  0.27602622],\n            #      [-0.84515425, -0.34503278]])\n\n            # R = [[-5.91607978, -7.43735744],\n            #      [ 0.        ,  0.82807867]])\n            \n            # one can verify : X = Q * R ;     \n    '
    if paddle.in_dynamic_mode():
        (q, r) = _C_ops.qr(x, 'mode', mode)
        if (mode == 'r'):
            return r
        else:
            return (q, r)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'qr')
    check_type(mode, 'mode', str, 'qr')
    helper = LayerHelper('qr', **locals())
    q = helper.create_variable_for_type_inference(dtype=x.dtype)
    r = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['mode'] = mode
    helper.append_op(type='qr', inputs={'X': [x]}, outputs={'Q': q, 'R': r}, attrs=attrs)
    if (mode == 'r'):
        return r
    else:
        return (q, r)
Computes the QR decomposition of one matrix or batches of matrice (backward is unsupported now).

Args:
    x (Tensor): The input tensor. Its shape should be `[..., M, N]`,
        where ... is zero or more batch dimensions. M and N can be arbitrary
        positive number. The data type of x should be float32 or float64. 
    mode (str, optional): A flag to control the behavior of qr, the default is "reduced". 
        Suppose x's shape is `[..., M, N]` and denoting `K = min(M, N)`:
        If mode = "reduced", qr op will return reduced Q and R matrices, 
        which means Q's shape is `[..., M, K]` and R's shape is `[..., K, N]`.
        If mode = "complete", qr op will return complete Q and R matrices, 
        which means Q's shape is `[..., M, M]` and R's shape is `[..., M, N]`.
        If mode = "r", qr op will only return reduced R matrix, which means
        R's shape is `[..., K, N]`.
    name (str, optional): Name for the operation (optional, default is None).
        For more information, please refer to :ref:`api_guide_Name`.
        
Returns:
    If mode = "reduced" or mode = "complete", qr will return a two tensor-tuple, which represents Q and R. 
    If mode = "r", qr will return a tensor which represents R.
    
Examples:            
    .. code-block:: python

        import paddle 

        x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype('float64')
        q, r = paddle.linalg.qr(x)
        print (q)
        print (r)

        # Q = [[-0.16903085,  0.89708523],
        #      [-0.50709255,  0.27602622],
        #      [-0.84515425, -0.34503278]])

        # R = [[-5.91607978, -7.43735744],
        #      [ 0.        ,  0.82807867]])
        
        # one can verify : X = Q * R ;
def qr(x, mode='reduced', name=None):
    '\n    Computes the QR decomposition of one matrix or batches of matrice (backward is unsupported now).\n\n    Args:\n        x (Tensor): The input tensor. Its shape should be `[..., M, N]`,\n            where ... is zero or more batch dimensions. M and N can be arbitrary\n            positive number. The data type of x should be float32 or float64. \n        mode (str, optional): A flag to control the behavior of qr, the default is "reduced". \n            Suppose x\'s shape is `[..., M, N]` and denoting `K = min(M, N)`:\n            If mode = "reduced", qr op will return reduced Q and R matrices, \n            which means Q\'s shape is `[..., M, K]` and R\'s shape is `[..., K, N]`.\n            If mode = "complete", qr op will return complete Q and R matrices, \n            which means Q\'s shape is `[..., M, M]` and R\'s shape is `[..., M, N]`.\n            If mode = "r", qr op will only return reduced R matrix, which means\n            R\'s shape is `[..., K, 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        If mode = "reduced" or mode = "complete", qr will return a two tensor-tuple, which represents Q and R. \n        If mode = "r", qr will return a tensor which represents R.\n        \n    Examples:            \n        .. code-block:: python\n\n            import paddle \n\n            x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype(\'float64\')\n            q, r = paddle.linalg.qr(x)\n            print (q)\n            print (r)\n\n            # Q = [[-0.16903085,  0.89708523],\n            #      [-0.50709255,  0.27602622],\n            #      [-0.84515425, -0.34503278]])\n\n            # R = [[-5.91607978, -7.43735744],\n            #      [ 0.        ,  0.82807867]])\n            \n            # one can verify : X = Q * R ;     \n    '
    if paddle.in_dynamic_mode():
        (q, r) = _C_ops.qr(x, 'mode', mode)
        if (mode == 'r'):
            return r
        else:
            return (q, r)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'qr')
    check_type(mode, 'mode', str, 'qr')
    helper = LayerHelper('qr', **locals())
    q = helper.create_variable_for_type_inference(dtype=x.dtype)
    r = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['mode'] = mode
    helper.append_op(type='qr', inputs={'X': [x]}, outputs={'Q': q, 'R': r}, attrs=attrs)
    if (mode == 'r'):
        return r
    else:
        return (q, r)