From df28a3b45219c31467aa1467b076377c766662f0 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Thu, 16 Aug 2018 13:16:54 +0800 Subject: [PATCH] fix lod and op test --- paddle/fluid/operators/fc_op.cc | 2 ++ paddle/fluid/operators/fusion_lstm_op.cc | 1 + python/paddle/fluid/tests/unittests/test_fusion_lstm_op.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/fc_op.cc b/paddle/fluid/operators/fc_op.cc index 5bee0e480ed..72287ae6ac6 100644 --- a/paddle/fluid/operators/fc_op.cc +++ b/paddle/fluid/operators/fc_op.cc @@ -134,6 +134,8 @@ class FCOpKernel : public framework::OpKernel { math::FCCompute( blas, in_dims[0], w_dims[1], w_dims[0], input_data, w_data, output_data, bias ? bias->data() : NULL); + + // TODO(TJ): fuse act } }; diff --git a/paddle/fluid/operators/fusion_lstm_op.cc b/paddle/fluid/operators/fusion_lstm_op.cc index b937f2edf19..3888333ec56 100644 --- a/paddle/fluid/operators/fusion_lstm_op.cc +++ b/paddle/fluid/operators/fusion_lstm_op.cc @@ -242,6 +242,7 @@ class FuisonLSTMKernel : public framework::OpKernel { to_batch(dev_ctx, *xx, batched_gate, true, is_reverse); } else { to_batch(dev_ctx, *x, xx, true, is_reverse); + batched_gate->set_lod(xx->lod()); math::FCCompute(blas, x_dims[0], wx_dims[1], x_dims[1], xx_data, wx_data, batched_gate_data, bias->data()); diff --git a/python/paddle/fluid/tests/unittests/test_fusion_lstm_op.py b/python/paddle/fluid/tests/unittests/test_fusion_lstm_op.py index 163e5cf6f80..381edbb3c12 100644 --- a/python/paddle/fluid/tests/unittests/test_fusion_lstm_op.py +++ b/python/paddle/fluid/tests/unittests/test_fusion_lstm_op.py @@ -112,7 +112,7 @@ class TestLstmOp(OpTest): } def test_check_output(self): - self.check_output(atol=1e-8) + self.check_output() class TestLstmOpInitReverse(TestLstmOp): -- GitLab