From 5913e735be6301215bbc6f4400833faa77a1ad62 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Thu, 21 Dec 2017 21:23:08 +0800 Subject: [PATCH] fix compile when merge --- paddle/operators/recv_op.cc | 5 +++-- paddle/operators/send_recv_op_test.cc | 8 ++++---- paddle/pybind/protobuf.cc | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/paddle/operators/recv_op.cc b/paddle/operators/recv_op.cc index efc9fdc46e8..4e91d1151eb 100644 --- a/paddle/operators/recv_op.cc +++ b/paddle/operators/recv_op.cc @@ -24,6 +24,7 @@ #include "paddle/framework/framework.pb.h" #include "paddle/framework/lod_tensor.h" #include "paddle/framework/op_registry.h" +#include "paddle/framework/proto_desc.h" #include "paddle/operators/detail/send_recv_impl.h" #include "paddle/operators/detail/simple_block_queue.h" @@ -117,9 +118,9 @@ class RecvOp : public framework::OperatorBase { rpc_service_->Reset(); std::string program_str = Attr("OptimizeProgram"); - framework::ProgramDesc program_desc; + framework::proto::ProgramDesc program_desc; program_desc.ParseFromString(program_str); - framework::ProgramDescBind program(program_desc); + framework::ProgramDesc program(program_desc); framework::Executor executor(dev_ctx); // Run sub graph to get optimized tensor try { diff --git a/paddle/operators/send_recv_op_test.cc b/paddle/operators/send_recv_op_test.cc index 1715b05c2ca..d899d8154cc 100644 --- a/paddle/operators/send_recv_op_test.cc +++ b/paddle/operators/send_recv_op_test.cc @@ -56,12 +56,12 @@ void AddOp(const std::string &type, const paddle::framework::VariableNameMap &inputs, const paddle::framework::VariableNameMap &outputs, paddle::framework::AttributeMap attrs, - paddle::framework::BlockDescBind *block) { + paddle::framework::BlockDesc *block) { // insert output for (auto kv : outputs) { for (auto v : kv.second) { auto var = block->Var(v); - var->SetDataType(paddle::framework::DataType::FP32); + var->SetDataType(paddle::framework::proto::DataType::FP32); } } @@ -83,8 +83,8 @@ void StartServerNet() { InitTensorsInScope(scope, place); // sub program run in recv_op, for simple test we use sum - paddle::framework::ProgramDescBind program; - paddle::framework::BlockDescBind *block = program.MutableBlock(0); + paddle::framework::ProgramDesc program; + paddle::framework::BlockDesc *block = program.MutableBlock(0); // X for server side tensors, RX for received tensers, must be of same shape. AddOp("sum", {{"X", {"x0", "x1"}}}, {{"Out", {"Out"}}}, {}, block); diff --git a/paddle/pybind/protobuf.cc b/paddle/pybind/protobuf.cc index 7fb0f072a15..f105370f226 100644 --- a/paddle/pybind/protobuf.cc +++ b/paddle/pybind/protobuf.cc @@ -159,7 +159,7 @@ void BindBlockDesc(py::module &m) { py::return_value_policy::reference) .def("prepend_op", &BlockDesc::PrependOp, py::return_value_policy::reference) - .def("remove_op", &BlockDescBind::RemoveOp) + .def("remove_op", &BlockDesc::RemoveOp) .def("var", [](BlockDesc &self, py::bytes byte_name) { std::string name = byte_name; @@ -251,7 +251,7 @@ void BindOpDesc(py::module &m) { .def("attr", &OpDesc::GetAttr) .def("set_block_attr", &OpDesc::SetBlockAttr) .def("set_serialized_attr", - [](OpDescBind &self, const std::string &name, + [](OpDesc &self, const std::string &name, const py::bytes &seriralized) { std::string ser(seriralized); self.SetAttr(name, ser); -- GitLab