From 2182ecfbbdeb0efb118f054ce62ca4f492dfc372 Mon Sep 17 00:00:00 2001 From: "Yang Yang(Tony)" Date: Tue, 24 Apr 2018 10:02:32 -0700 Subject: [PATCH] remove duplicated ShareLoD in gru_op and sequence_conv_op (#10149) * remove share lod; it has already been performed in infershape * slightly release test bound of test_image_classification --- paddle/fluid/operators/gru_op.h | 2 -- paddle/fluid/operators/sequence_conv_op.h | 1 - python/paddle/fluid/tests/book/test_image_classification.py | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/paddle/fluid/operators/gru_op.h b/paddle/fluid/operators/gru_op.h index 1d5c29149..53f844a66 100644 --- a/paddle/fluid/operators/gru_op.h +++ b/paddle/fluid/operators/gru_op.h @@ -56,8 +56,6 @@ class GRUKernel : public framework::OpKernel { auto* hidden = context.Output("Hidden"); hidden->mutable_data(context.GetPlace()); - context.ShareLoD("Input", "Hidden"); - auto hidden_dims = hidden->dims(); bool is_reverse = context.Attr("is_reverse"); diff --git a/paddle/fluid/operators/sequence_conv_op.h b/paddle/fluid/operators/sequence_conv_op.h index b59504bb9..3916cdbb6 100644 --- a/paddle/fluid/operators/sequence_conv_op.h +++ b/paddle/fluid/operators/sequence_conv_op.h @@ -33,7 +33,6 @@ class SequenceConvKernel : public framework::OpKernel { auto filter = *context.Input("Filter"); out->mutable_data(context.GetPlace()); - context.ShareLoD("X", "Out"); int context_start = context.Attr("contextStart"); int context_length = context.Attr("contextLength"); diff --git a/python/paddle/fluid/tests/book/test_image_classification.py b/python/paddle/fluid/tests/book/test_image_classification.py index d3c14b83f..db96c82ce 100644 --- a/python/paddle/fluid/tests/book/test_image_classification.py +++ b/python/paddle/fluid/tests/book/test_image_classification.py @@ -244,7 +244,7 @@ def infer(use_cuda, save_dirname=None): assert len(results[0]) == len(transpiler_results[0]) for i in range(len(results[0])): np.testing.assert_almost_equal( - results[0][i], transpiler_results[0][i], decimal=6) + results[0][i], transpiler_results[0][i], decimal=5) print("infer results: ", results[0]) -- GitLab