From commits-return-36455-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Wed May 23 20:37:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2A5E7180645 for ; Wed, 23 May 2018 20:37:24 +0200 (CEST) Received: (qmail 10323 invoked by uid 500); 23 May 2018 18:37:24 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 10311 invoked by uid 99); 23 May 2018 18:37:24 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2018 18:37:24 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] piiswrong closed pull request #11035: added more detailed error messages for potri/potrf Message-ID: <152710064373.22617.12713347750225578507.gitbox@gitbox.apache.org> Date: Wed, 23 May 2018 18:37:23 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit piiswrong closed pull request #11035: added more detailed error messages for potri/potrf URL: https://github.com/apache/incubator-mxnet/pull/11035 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/src/operator/linalg_impl.h b/src/operator/linalg_impl.h index d1286170c2c..151db60975e 100644 --- a/src/operator/linalg_impl.h +++ b/src/operator/linalg_impl.h @@ -494,6 +494,9 @@ LINALG_XPU_BATCH_TRMM(gpu, double) // for further information about the function and its parameters. // Note that this is A = potrf(A), so A is input and output parameter. +static const char *potrf_errstr + = "This may happen when the input matrix is either not symmetric or not positive definite."; + template inline void check_potrf(const Tensor& A, bool lower) { // Any checking that helps user debug potential problems. @@ -507,7 +510,7 @@ void linalg_potrf(const Tensor& A, bool lower, Stream check_potrf(A, lower); \ int ret(MXNET_LAPACK_##fname(MXNET_LAPACK_ROW_MAJOR, (lower ? 'L' : 'U'), A.size(0), \ A.dptr_ , A.stride_)); \ - CHECK_EQ(ret, 0) << #fname << " failed in lapack on cpu."; \ + CHECK_EQ(ret, 0) << #fname << " failed in lapack on cpu. " << potrf_errstr; \ } LINALG_CPU_POTRF(spotrf, float) LINALG_CPU_POTRF(dpotrf, double) @@ -589,6 +592,10 @@ LINALG_GPU_BATCH_POTRF(DnDpotrf, double) // for further information about the function and its parameters. // Note that this is A = potri(A), so A is input and output parameter. +static const char *potri_errstr + = "This may happen when the input matrix is not a Cholesky factorization obtained" + " by a prior call of the potrf-operator."; + template inline void check_potri(const Tensor& A, bool lower) { // Any checking that helps user debug potential problems. @@ -601,7 +608,7 @@ void linalg_potri(const Tensor& A, bool lower, Stream check_potri(A, lower); \ int ret(MXNET_LAPACK_##fname(MXNET_LAPACK_ROW_MAJOR, (lower ? 'L' : 'U'), A.size(0), \ A.dptr_ , A.stride_)); \ - CHECK_EQ(ret, 0) << #fname << " failed in lapack on cpu."; \ + CHECK_EQ(ret, 0) << #fname << " failed in lapack on cpu. " << potri_errstr; \ } LINALG_CPU_POTRI(spotri, float) LINALG_CPU_POTRI(dpotri, double) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services