From ee4795d115c6f2242ede4d18b6bf64ee709087c4 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Tue, 12 May 2020 18:54:42 +0800 Subject: [PATCH] fix PADDLE_THROW in spectral_norm_op.h. test=develop (#24415) --- paddle/fluid/operators/spectral_norm_op.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/spectral_norm_op.h b/paddle/fluid/operators/spectral_norm_op.h index eb48e3b7840..954edc79691 100644 --- a/paddle/fluid/operators/spectral_norm_op.h +++ b/paddle/fluid/operators/spectral_norm_op.h @@ -33,7 +33,9 @@ static inline void TransCompute(const int rank, const Tensor& in, Tensor* out, const std::vector& perm, const DeviceContext& dev_ctx) { if (rank <= 1 || rank > 5) { - PADDLE_THROW("Invalid weight rank."); + PADDLE_THROW(paddle::platform::errors::Fatal( + "Weight rank of SpectralNorm should be in range [2, 5], but got %d.", + rank)); } switch (rank) { -- GitLab