From 6435d1b4b867e8665a809d811ccc40b1f397e059 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Tue, 12 May 2020 18:54:34 +0800 Subject: [PATCH] fix PADDLE_THROW in spectral_norm_op.h. test=develop (#24414) --- 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 eb48e3b784..954edc7969 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