From f117feab0c8767791307c5653acb11b0fea622f8 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Tue, 25 Sep 2018 10:53:25 +0800 Subject: [PATCH] modify comments --- paddle/fluid/API.spec | 2 +- paddle/fluid/framework/details/build_strategy.h | 9 ++++----- paddle/fluid/pybind/pybind.cc | 2 +- python/paddle/fluid/tests/unittests/test_pass_builder.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index 7cda403f7..05bd6bfd2 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -63,7 +63,7 @@ paddle.fluid.ExecutionStrategy.__init__ __init__(self: paddle.fluid.core.Executi paddle.fluid.BuildStrategy.GradientScaleStrategy.__init__ __init__(self: paddle.fluid.core.GradientScaleStrategy, arg0: int) -> None paddle.fluid.BuildStrategy.ReduceStrategy.__init__ __init__(self: paddle.fluid.core.ReduceStrategy, arg0: int) -> None paddle.fluid.BuildStrategy.__init__ __init__(self: paddle.fluid.core.BuildStrategy) -> None -paddle.fluid.BuildStrategy.create_passes_from_srategy create_passes_from_srategy(self: paddle.fluid.core.BuildStrategy) -> paddle.fluid.core.PassBuilder +paddle.fluid.BuildStrategy.create_passes_from_strategy create_passes_from_strategy(self: paddle.fluid.core.BuildStrategy) -> paddle.fluid.core.PassBuilder paddle.fluid.create_lod_tensor ArgSpec(args=['data', 'recursive_seq_lens', 'place'], varargs=None, keywords=None, defaults=None) paddle.fluid.create_random_int_lodtensor ArgSpec(args=['recursive_seq_lens', 'base_shape', 'place', 'low', 'high'], varargs=None, keywords=None, defaults=None) paddle.fluid.io.save_vars ArgSpec(args=['executor', 'dirname', 'main_program', 'vars', 'predicate', 'filename'], varargs=None, keywords=None, defaults=(None, None, None, None)) diff --git a/paddle/fluid/framework/details/build_strategy.h b/paddle/fluid/framework/details/build_strategy.h index 79bc16590..02c4bea16 100644 --- a/paddle/fluid/framework/details/build_strategy.h +++ b/paddle/fluid/framework/details/build_strategy.h @@ -69,12 +69,11 @@ struct BuildStrategy { bool enable_data_balance_{false}; - // The PassBuilder assembles passes based on the configs defined above. - // For example, if fuse_elewise_add_act_ops_ is true, the corresponding - // fuse pass will be added. + // User normally doesn't need to call this API. // The PassBuilder allows for more customized insert, remove of passes - // from python. - // A new PassBuilder is created and passes are owned by the PassBuilder. + // from python side. + // A new PassBuilder is created based on configs defined above and + // passes are owned by the PassBuilder. std::shared_ptr CreatePassesFromStrategy() const; // Apply the passes built by the pass_builder_. The passes will be diff --git a/paddle/fluid/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc index f4ccadccc..a384d07f3 100644 --- a/paddle/fluid/pybind/pybind.cc +++ b/paddle/fluid/pybind/pybind.cc @@ -702,7 +702,7 @@ All parameter, weight, gradient are variables in Paddle. [](BuildStrategy &self, bool b) { self.fuse_elewise_add_act_ops_ = b; }) - .def("create_passes_from_srategy", + .def("create_passes_from_strategy", [](BuildStrategy &self) -> std::shared_ptr { return self.CreatePassesFromStrategy(); }); diff --git a/python/paddle/fluid/tests/unittests/test_pass_builder.py b/python/paddle/fluid/tests/unittests/test_pass_builder.py index 0abd6fe49..cb336d19c 100644 --- a/python/paddle/fluid/tests/unittests/test_pass_builder.py +++ b/python/paddle/fluid/tests/unittests/test_pass_builder.py @@ -94,7 +94,7 @@ class TestPassBuilder(unittest.TestCase): def test_parallel_testing_with_new_strategy(self): build_strategy = fluid.BuildStrategy() - pass_builder = build_strategy.create_passes_from_srategy() + pass_builder = build_strategy.create_passes_from_strategy() origin_len = len(pass_builder.all_passes()) viz_pass = pass_builder.append_pass("graph_viz_pass") -- GitLab