Skip to content

Commit 87be315

Browse files
committed
Merge pull request #16897 from velconia/fix_split_lod_tensor_op_infer_shape
Fix infer shape of split lod tensor op
1 parent 2055c16 commit 87be315

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

paddle/fluid/operators/split_lod_tensor_op.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ class SplitLoDTensorInferShape : public framework::InferShapeBase {
157157

158158
auto mask_dim = context->GetInputDim("Mask");
159159
PADDLE_ENFORCE_EQ(mask_dim.size(), 2);
160-
PADDLE_ENFORCE_EQ(mask_dim[1], 1);
160+
if (context->IsRuntime()) {
161+
PADDLE_ENFORCE_EQ(mask_dim[1], 1);
162+
}
161163

162164
context->SetOutputDim("OutTrue", context->GetInputDim("X"));
163165
context->SetOutputDim("OutFalse", context->GetInputDim("X"));

0 commit comments

Comments
 (0)