diff --git a/paddle/fluid/operators/spectral_norm_op.h b/paddle/fluid/operators/spectral_norm_op.h index eb48e3b7840e18efe809540dd697f243a0a63a52..954edc796914c84fc81898c581cb75ff6b16468d 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) {