From 3b49372ff3e28915532c8bc066e4c15087516dfb Mon Sep 17 00:00:00 2001 From: Li Fuchen Date: Fri, 4 Oct 2019 14:38:10 +0800 Subject: [PATCH] Set lod level of sequence_unpad's output to 1 in compile time (#20068) (#20137) * Set lod level of sequence_unpad's output to 1 in compile time test=release/1.6 --- 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