From bc3e0d6e01e71298bc99a87930dc654d83853574 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Fri, 11 Jan 2019 13:18:24 +0800 Subject: [PATCH] Fix expand op compile time bug test=develop --- paddle/fluid/operators/expand_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/expand_op.cc b/paddle/fluid/operators/expand_op.cc index 40f7c1c54c8..d3cf0947959 100644 --- a/paddle/fluid/operators/expand_op.cc +++ b/paddle/fluid/operators/expand_op.cc @@ -48,7 +48,7 @@ class ExpandOp : public framework::OperatorWithKernel { } // set the first dim to -1 in compile time - if (!ctx->IsRuntime()) { + if (!ctx->IsRuntime() && x_dims[0] < 0) { out_shape[0] = x_dims[0]; } -- GitLab