mindspore.ops.cholesky

View Source On Gitee
mindspore.ops.cholesky(input_x, upper=False)[source]

Return the Cholesky decomposition of zero or more batch dimensions consisting of symmetric positive-definite matrices.

If upper is True, return an upper-triangular matrix, U, and the decomposition has the form:

A=UTU

If upper is False, return a lower-triangular matrix, L, and the decomposition has the form:

A=LLT

where A is the symmetric positive-definite matrix.

Parameters
  • input_x (Tensor) – The input tensor of shape (,N,N), where is batch dimensions. In the above formula, A .

  • upper (bool, optional) – Return an upper-triangular matrix or not. Default: False .

Returns

Tensor

Supported Platforms:

GPU CPU

Examples

>>> import mindspore
>>> input_x = mindspore.tensor([[1.0, 1.0], [1.0, 2.0]])
>>> output = mindspore.ops.cholesky(input_x, upper=False)
>>> print(output)
[[1. 0.]
 [1. 1.]]