From 5365cd2f14e5ae12ca41ef061882f56e33775c13 Mon Sep 17 00:00:00 2001 From: Li Fuchen Date: Mon, 30 Sep 2019 13:57:50 +0800 Subject: [PATCH] Set lod level of sequence_unpad's output to 1 in compile time (#20068) * Set lod level of sequence_unpad's output to 1 in compile time --- paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc b/paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc index 23581c360ff..8256460858b 100644 --- a/paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc +++ b/paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc @@ -57,6 +57,11 @@ class SequenceUnpadOp : public framework::OperatorWithKernel { } } ctx->SetOutputDim("Out", framework::make_ddim(out_dims_vec)); + if (!ctx->IsRuntime()) { + framework::VarDesc* out_desc = + boost::get(ctx->GetOutputVarPtrs("Out")[0]); + out_desc->SetLoDLevel(1); + } } protected: -- GitLab