From 9f34374b480b2f6c2a6c99d65bf6dbec2b1b15f7 Mon Sep 17 00:00:00 2001 From: cc <52520497+juncaipeng@users.noreply.github.com> Date: Tue, 5 Jan 2021 16:55:53 +0800 Subject: [PATCH] Fix the formate of raising error in randperm op (#30108) * fix the formate of raising error in randperm op --- paddle/fluid/operators/randperm_op.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/randperm_op.cc b/paddle/fluid/operators/randperm_op.cc index deafd651e90..5d740a7407f 100644 --- a/paddle/fluid/operators/randperm_op.cc +++ b/paddle/fluid/operators/randperm_op.cc @@ -31,7 +31,9 @@ class RandpermOp : public framework::OperatorWithKernel { int n = ctx->Attrs().Get("n"); PADDLE_ENFORCE_GT( n, 0, platform::errors::InvalidArgument( - "The input(n) of randperm op must be greater than 0.")); + "The input 'n' of randperm op should be greater than 0. " + "But received %d.", + n)); ctx->SetOutputDim("Out", framework::make_ddim({n})); } -- GitLab