From b68a95f7f488f8ff94f4793ec294121aa004d02d Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Sat, 7 Oct 2017 00:47:19 +0000 Subject: [PATCH] prune pass simple test --- paddle/framework/executor.cc | 2 ++ paddle/framework/executor.h | 4 ++++ paddle/framework/executor_test.cc | 1 + 3 files changed, 7 insertions(+) diff --git a/paddle/framework/executor.cc b/paddle/framework/executor.cc index 10d22ba01c..4f217277d0 100644 --- a/paddle/framework/executor.cc +++ b/paddle/framework/executor.cc @@ -145,9 +145,11 @@ std::vector Executor::Preprocess(const ProgramDesc& pdesc) { // this op should be executed should_run.push_back(true); + LOG(INFO) << "Yes " << op_desc.type(); } else { // this op should NOT be executed should_run.push_back(false); + LOG(INFO) << "No " << op_desc.type(); } } diff --git a/paddle/framework/executor.h b/paddle/framework/executor.h index 1d2e6c96de..75cb5939ff 100644 --- a/paddle/framework/executor.h +++ b/paddle/framework/executor.h @@ -38,9 +38,13 @@ class Executor { protected: /* @Brief + * Pruning the graph * * @param * ProgramDesc + * + * @return + * vector Same size as ops. Indicates whether an op should be run. */ std::vector Preprocess(const ProgramDesc& pdesc); diff --git a/paddle/framework/executor_test.cc b/paddle/framework/executor_test.cc index bf6c1dffc1..6a4b2e3d1a 100644 --- a/paddle/framework/executor_test.cc +++ b/paddle/framework/executor_test.cc @@ -226,6 +226,7 @@ class ExecutorTesterFeed : public ::testing::Test { Out->set_parameter("Out"); Out->add_arguments("c"); + add_fetch_op("a", dim, 0, root_block); add_fetch_op("c", dim, 0, root_block); std::vector vec1 = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; -- GitLab