From 87be315c0e78649ef2e25e9d43fea410e30cfdca Mon Sep 17 00:00:00 2001 From: Hongyu Liu <43953930+phlrain@users.noreply.github.com> Date: Wed, 17 Apr 2019 10:01:21 +0800 Subject: [PATCH] Merge pull request #16897 from velconia/fix_split_lod_tensor_op_infer_shape Fix infer shape of split lod tensor op --- paddle/fluid/operators/split_lod_tensor_op.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/split_lod_tensor_op.cc b/paddle/fluid/operators/split_lod_tensor_op.cc index 5ede972c71f..c89e683d766 100644 --- a/paddle/fluid/operators/split_lod_tensor_op.cc +++ b/paddle/fluid/operators/split_lod_tensor_op.cc @@ -157,7 +157,9 @@ class SplitLoDTensorInferShape : public framework::InferShapeBase { auto mask_dim = context->GetInputDim("Mask"); PADDLE_ENFORCE_EQ(mask_dim.size(), 2); - PADDLE_ENFORCE_EQ(mask_dim[1], 1); + if (context->IsRuntime()) { + PADDLE_ENFORCE_EQ(mask_dim[1], 1); + } context->SetOutputDim("OutTrue", context->GetInputDim("X")); context->SetOutputDim("OutFalse", context->GetInputDim("X")); -- GitLab