mindspore.ops.orgqr
- mindspore.ops.orgqr(input, input2)[source]
Calculates the explicit representation of the orthogonal matrix
returned bymindspore.ops.Geqrf
.Take the case of input without batch dimension as an example, computes the first
columns of a product of Householder matrices. Suppose input input is a matrix of size after householder transformation. When the diagonal of input is set to 1, every colunm of lower triangular in input is denoted as for for , this function returns the first columns of the matrixwhere
is the -dimensional identity matrix. And when is complex, is the conjugate transpose, otherwise the transpose. The output matrix is the same size as the input matrix input. is corresponding to input2.- Parameters
- Returns
Tensor, has the same shape and data type as input.
- Raises
TypeError – If input or input2 are not Tensors.
TypeError – If dtype of input and input2 is not one of: float64, float32, complex64, complex128.
ValueError – If input and input2 have different batch size.
ValueError – If input.shape[-2] < input.shape[-1].
ValueError – If input.shape[-1] < input2.shape[-1].
ValueError – If rank(input) - rank(input2) != 1.
ValueError – If rank(input) != 2 or 3.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> input = Tensor(np.array([[-114.6, 10.9, 1.1], [-0.304, 38.07, 69.38], [-0.45, -0.17, 62.]]), ... mindspore.float32) >>> input2 = Tensor(np.array([1.55, 1.94, 0.0]), mindspore.float32) >>> y = ops.orgqr(input, input2) >>> print(y) [[-0.54999995 -0.2128925 0.8137956 ] [ 0.47119996 -0.8752807 0.08240613] [ 0.69749993 0.42560163 0.57772595]]