From e46ffaf288c782977ae83a329a7067481aed2476 Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Tue, 14 Sep 2021 13:58:22 +0800 Subject: [PATCH] fix conv op check (#35693) --- paddle/fluid/operators/conv_op.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/conv_op.cc b/paddle/fluid/operators/conv_op.cc index 5ce8422c9ad..4cd20e6ecd5 100644 --- a/paddle/fluid/operators/conv_op.cc +++ b/paddle/fluid/operators/conv_op.cc @@ -116,10 +116,13 @@ std::vector ConvOp::ComputeOutputShape( "the output channels is %d, the filter's shape is [%s], " "the groups is %d.", filter_dims[0], filter_dims, groups)); - PADDLE_ENFORCE_GT( - filter_dims[0], 0, - platform::errors::InvalidArgument( - "the size of filter at axis 0 should be greater than 0")); + + if (ctx->IsRuntime()) { + PADDLE_ENFORCE_GT( + filter_dims[0], 0, + platform::errors::InvalidArgument( + "the size of filter at axis 0 should be greater than 0")); + } framework::DDim in_data_dims; if (channel_last) { -- GitLab