ormqr

paddle.linalg. ormqr ( x, tau, y, left=True, transpose=False, name=None ) [source]

Calculate the product of a normal matrix and a householder matrix. Compute the product of the matrix C (given by y) with dimensions (m, n) and a matrix Q, where Q is generated by the Householder reflection coefficient (x, tau). Returns a Tensor.

Parameters
  • x (Tensor) – Shape(*,mn, k), when left is True, the value of mn is equal to m, otherwise the value of mn is equal to n. * indicates that the length of the tensor on axis 0 is 0 or greater.

  • tau (Tensor) – Shape (*, min(mn, k)), where * indicates that the length of the Tensor on axis 0 is 0 or greater, and its type is the same as input.

  • y (Tensor) – Shape (*m,n), where * indicates that the length of the Tensor on axis 0 is 0 or greater, and its type is the same as input.

  • left (bool, optional) – Determines the order in which the matrix product operations are operated. If left is true, the order of evaluation is op(Q) * y, otherwise, the order of evaluation is y * op(Q). Default value: True.

  • transpose (bool, optional) – If true, the matrix Q is conjugated and transposed, otherwise, the conjugate transpose transformation is not performed. Default value: False.

  • name (str, optional) – For details, please refer to Name. Generally, no setting is required. Default: None.

Returns

Tensor. Data type and dimension are equals with y.

Examples

>>> import paddle
>>> import numpy as np
>>> from paddle import  linalg

>>> input = paddle.to_tensor([[-114.6, 10.9, 1.1], [-0.304, 38.07, 69.38], [-0.45, -0.17, 62]])
>>> tau = paddle.to_tensor([1.55, 1.94, 3.0])
>>> y = paddle.to_tensor([[-114.6, 10.9, 1.1], [-0.304, 38.07, 69.38], [-0.45, -0.17, 62]])
>>> output = linalg.ormqr(input, tau, y)
>>> print(output)
Tensor(shape=[3, 3], dtype=float32, place=Place(cpu), stop_gradient=True,
    [[ 63.82712936 , -13.82312393 , -116.28614044],
    [-53.65926361 , -28.15783691 , -70.42700958 ],
    [-79.54292297 ,  24.00182915 , -41.34253311 ]])