Skip to content

Commit bdbf1bc

Browse files
authored
Merge pull request #12953 from jerrywgz/fix_prelu
add error_info for prelu_op
2 parents 3725f22 + 835573b commit bdbf1bc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

paddle/fluid/operators/prelu_op.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ class PReluOp : public framework::OperatorWithKernel {
2626
std::string mode = ctx->Attrs().Get<std::string>("mode");
2727

2828
auto x_dim = ctx->GetInputDim("X");
29-
PADDLE_ENFORCE(ctx->HasInput("X"), "Input(X) should not be null");
30-
PADDLE_ENFORCE(ctx->HasInput("Alpha"), "Input(Alpha) should not be null");
29+
PADDLE_ENFORCE(ctx->HasInput("X"),
30+
"Input(X) of PreluOp should not be null");
31+
PADDLE_ENFORCE(ctx->HasInput("Alpha"),
32+
"Input(Alpha) of PreluOp should not be null");
3133

32-
PADDLE_ENFORCE(ctx->HasOutput("Out"), "Output(Out) should not be null");
34+
PADDLE_ENFORCE(ctx->HasOutput("Out"),
35+
"Output(Out) of PreluOp should not be null");
3336
if (mode == "all") {
3437
PADDLE_ENFORCE(product(ctx->GetInputDim("Alpha")) == 1,
3538
"For mode 'all', size of weight Alpha must be one.");

0 commit comments

Comments
 (0)