From 4bcb42549048771d563f136027fc7581faab7687 Mon Sep 17 00:00:00 2001 From: y0ast Date: Sat, 15 Dec 2018 04:41:02 -0800 Subject: [PATCH] fix cholesky call in potrs example (#15215) Summary: Cholesky by default returns the lower triangular matrix, see [docs](https://pytorch.org/docs/stable/torch.html#torch.cholesky). However `torch.potrs` by default requires the upper triangular matrix. The naming of the variable `u` suggests that the example expects the upper to be returned, so I've added the flag to make that happen in the example. Pull Request resolved: https://github.com/pytorch/pytorch/pull/15215 Differential Revision: D13476468 Pulled By: soumith fbshipit-source-id: 7b68035f435a2b1be4d363b3f63e407394af949d --- torch/_torch_docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch/_torch_docs.py b/torch/_torch_docs.py index 744b111..90cf0d2 100644 --- a/torch/_torch_docs.py +++ b/torch/_torch_docs.py @@ -3455,7 +3455,7 @@ Example:: >>> a = torch.randn(3, 3) >>> a = torch.mm(a, a.t()) # make symmetric positive definite - >>> u = torch.cholesky(a) + >>> u = torch.cholesky(a, upper=True) >>> a tensor([[ 0.7747, -1.9549, 1.3086], [-1.9549, 6.7546, -5.4114], -- 2.7.4