From 0e30c9d6fbcd0370c4944c5314c011f8c631d6d0 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Thu, 19 Jul 2018 14:55:11 +0800 Subject: [PATCH] fix mac build --- paddle/fluid/framework/details/multi_devices_graph_builder.cc | 2 +- paddle/fluid/framework/details/ssa_graph_checker.h | 2 +- paddle/fluid/framework/details/ssa_graph_printer.h | 2 +- paddle/fluid/framework/ir/graph.cc | 1 + paddle/fluid/inference/CMakeLists.txt | 4 +++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/details/multi_devices_graph_builder.cc b/paddle/fluid/framework/details/multi_devices_graph_builder.cc index c52980472de..f1f8674caf6 100644 --- a/paddle/fluid/framework/details/multi_devices_graph_builder.cc +++ b/paddle/fluid/framework/details/multi_devices_graph_builder.cc @@ -333,7 +333,7 @@ std::unique_ptr MultiDevSSAGraphBuilder::Apply( * Only variables should be the leaves of graph. */ AddOutputToLeafOps(&result); - return std::move(graph); + return graph; } bool MultiDevSSAGraphBuilder::IsSparseGradient(const std::string &og) const { diff --git a/paddle/fluid/framework/details/ssa_graph_checker.h b/paddle/fluid/framework/details/ssa_graph_checker.h index f1080610381..2e397e86825 100644 --- a/paddle/fluid/framework/details/ssa_graph_checker.h +++ b/paddle/fluid/framework/details/ssa_graph_checker.h @@ -31,7 +31,7 @@ class SSAGraghBuilderWithChecker : public SSAGraphBuilder { std::unique_ptr Apply(std::unique_ptr graph) const override { auto new_graph = builder_->Apply(std::move(graph)); PADDLE_ENFORCE(IsValidGraph(new_graph.get())); - return std::move(new_graph); + return new_graph; } int GetVarDeviceID(const std::string& var_name) const override { diff --git a/paddle/fluid/framework/details/ssa_graph_printer.h b/paddle/fluid/framework/details/ssa_graph_printer.h index 411be02988a..cd72162f44c 100644 --- a/paddle/fluid/framework/details/ssa_graph_printer.h +++ b/paddle/fluid/framework/details/ssa_graph_printer.h @@ -53,7 +53,7 @@ class SSAGraghBuilderWithPrinter : public SSAGraphBuilder { std::unique_ptr Apply(std::unique_ptr graph) const override { auto new_graph = builder_->Apply(std::move(graph)); printer_->Print(*new_graph, stream_ref_); - return std::move(new_graph); + return new_graph; } int GetVarDeviceID(const std::string& var_name) const override { diff --git a/paddle/fluid/framework/ir/graph.cc b/paddle/fluid/framework/ir/graph.cc index 688f7ba5825..702baf93259 100644 --- a/paddle/fluid/framework/ir/graph.cc +++ b/paddle/fluid/framework/ir/graph.cc @@ -21,6 +21,7 @@ namespace framework { // NOTE(paddle-dev): This graph contains circle. Graph::Graph(const ProgramDesc &program) : program_(program) { + VLOG(3) << "block in program:" << program_.Size(); std::unordered_map all_vars; for (auto *var : program.Block(0).AllVars()) { all_vars.emplace(var->Name(), var); diff --git a/paddle/fluid/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt index c9eff0fc28c..16c9c81258a 100644 --- a/paddle/fluid/inference/CMakeLists.txt +++ b/paddle/fluid/inference/CMakeLists.txt @@ -38,4 +38,6 @@ if(WITH_TESTING) # both tests/book and analysis depends the models that generated by python/paddle/fluid/tests/book add_subdirectory(tests/book) endif() -add_subdirectory(api) +if(NOT APPLE) + add_subdirectory(api) +endif() -- GitLab