From 0d4b60ab8bc8d1db9fdef1a6228663c3f60a3980 Mon Sep 17 00:00:00 2001 From: jerrywgz Date: Mon, 21 Jan 2019 12:25:07 +0000 Subject: [PATCH] add lod for slice op, test=develop --- paddle/fluid/operators/slice_op.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/fluid/operators/slice_op.cc b/paddle/fluid/operators/slice_op.cc index 789e61b2d33..94995fc9961 100644 --- a/paddle/fluid/operators/slice_op.cc +++ b/paddle/fluid/operators/slice_op.cc @@ -54,6 +54,9 @@ class SliceOp : public framework::OperatorWithKernel { out_dims[axes[i]] = end - start; } ctx->SetOutputDim("Out", out_dims); + if (axes[0] != 0) { + ctx->ShareLoD("Input", /*->*/ "Out"); + } } protected: -- GitLab