From 768551b25d5d51ad0426856fb2d33958701a4350 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Thu, 31 Oct 2019 10:49:11 +0800 Subject: [PATCH] Add parameter init check add run_startup_progrom error message for fc(mul) (#20906) --- paddle/fluid/operators/mul_op.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paddle/fluid/operators/mul_op.cc b/paddle/fluid/operators/mul_op.cc index 09c544ec026..119aa688839 100644 --- a/paddle/fluid/operators/mul_op.cc +++ b/paddle/fluid/operators/mul_op.cc @@ -49,6 +49,12 @@ class MulOp : public framework::OperatorWithKernel { << " x_num_col_dims=" << x_num_col_dims << " y_num_col_dims=" << y_num_col_dims; + PADDLE_ENFORCE_NE(framework::product(y_dims), 0, + "Maybe the Input variable Y(%s) has not " + "been initialized. You may need to confirm " + "if you put exe.run(startup_program) " + "after optimizer.minimize function.", + ctx->Inputs("Y").front()); PADDLE_ENFORCE_GT(x_dims.size(), x_num_col_dims, "ShapeError: The input tensor X's dimensions of MulOp " "should be larger than x_num_col_dims. But received X's " -- GitLab