cupy.linalg.qr#
- cupy.linalg.qr(a, mode='reduced')[source]#
QR decomposition.
Decompose a given two-dimensional matrix into
Q * R
, whereQ
is an orthonormal andR
is an upper-triangular matrix.- Parameters:
a (cupy.ndarray) – The input matrix.
mode (str) – The mode of decomposition. Currently ‘reduced’, ‘complete’, ‘r’, and ‘raw’ modes are supported. The default mode is ‘reduced’, in which matrix
A = (..., M, N)
is decomposed intoQ
,R
with dimensions(..., M, K)
,(..., K, N)
, whereK = min(M, N)
.
- Returns:
Although the type of returned object depends on the mode, it returns a tuple of
(Q, R)
by default. For details, please see the document ofnumpy.linalg.qr()
.- Return type:
cupy.ndarray, or tuple of ndarray
Warning
This function calls one or more cuSOLVER routine(s) which may yield invalid results if input conditions are not met. To detect these invalid results, you can set the linalg configuration to a value that is not ignore in
cupyx.errstate()
orcupyx.seterr()
.See also