提交 5913e735 编写于 作者: T typhoonzero

fix compile when merge

上级 b8484161
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "paddle/framework/framework.pb.h" #include "paddle/framework/framework.pb.h"
#include "paddle/framework/lod_tensor.h" #include "paddle/framework/lod_tensor.h"
#include "paddle/framework/op_registry.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/send_recv_impl.h"
#include "paddle/operators/detail/simple_block_queue.h" #include "paddle/operators/detail/simple_block_queue.h"
...@@ -117,9 +118,9 @@ class RecvOp : public framework::OperatorBase { ...@@ -117,9 +118,9 @@ class RecvOp : public framework::OperatorBase {
rpc_service_->Reset(); rpc_service_->Reset();
std::string program_str = Attr<std::string>("OptimizeProgram"); std::string program_str = Attr<std::string>("OptimizeProgram");
framework::ProgramDesc program_desc; framework::proto::ProgramDesc program_desc;
program_desc.ParseFromString(program_str); program_desc.ParseFromString(program_str);
framework::ProgramDescBind program(program_desc); framework::ProgramDesc program(program_desc);
framework::Executor executor(dev_ctx); framework::Executor executor(dev_ctx);
// Run sub graph to get optimized tensor // Run sub graph to get optimized tensor
try { try {
......
...@@ -56,12 +56,12 @@ void AddOp(const std::string &type, ...@@ -56,12 +56,12 @@ void AddOp(const std::string &type,
const paddle::framework::VariableNameMap &inputs, const paddle::framework::VariableNameMap &inputs,
const paddle::framework::VariableNameMap &outputs, const paddle::framework::VariableNameMap &outputs,
paddle::framework::AttributeMap attrs, paddle::framework::AttributeMap attrs,
paddle::framework::BlockDescBind *block) { paddle::framework::BlockDesc *block) {
// insert output // insert output
for (auto kv : outputs) { for (auto kv : outputs) {
for (auto v : kv.second) { for (auto v : kv.second) {
auto var = block->Var(v); auto var = block->Var(v);
var->SetDataType(paddle::framework::DataType::FP32); var->SetDataType(paddle::framework::proto::DataType::FP32);
} }
} }
...@@ -83,8 +83,8 @@ void StartServerNet() { ...@@ -83,8 +83,8 @@ void StartServerNet() {
InitTensorsInScope(scope, place); InitTensorsInScope(scope, place);
// sub program run in recv_op, for simple test we use sum // sub program run in recv_op, for simple test we use sum
paddle::framework::ProgramDescBind program; paddle::framework::ProgramDesc program;
paddle::framework::BlockDescBind *block = program.MutableBlock(0); paddle::framework::BlockDesc *block = program.MutableBlock(0);
// X for server side tensors, RX for received tensers, must be of same shape. // X for server side tensors, RX for received tensers, must be of same shape.
AddOp("sum", {{"X", {"x0", "x1"}}}, {{"Out", {"Out"}}}, {}, block); AddOp("sum", {{"X", {"x0", "x1"}}}, {{"Out", {"Out"}}}, {}, block);
......
...@@ -159,7 +159,7 @@ void BindBlockDesc(py::module &m) { ...@@ -159,7 +159,7 @@ void BindBlockDesc(py::module &m) {
py::return_value_policy::reference) py::return_value_policy::reference)
.def("prepend_op", &BlockDesc::PrependOp, .def("prepend_op", &BlockDesc::PrependOp,
py::return_value_policy::reference) py::return_value_policy::reference)
.def("remove_op", &BlockDescBind::RemoveOp) .def("remove_op", &BlockDesc::RemoveOp)
.def("var", .def("var",
[](BlockDesc &self, py::bytes byte_name) { [](BlockDesc &self, py::bytes byte_name) {
std::string name = byte_name; std::string name = byte_name;
...@@ -251,7 +251,7 @@ void BindOpDesc(py::module &m) { ...@@ -251,7 +251,7 @@ void BindOpDesc(py::module &m) {
.def("attr", &OpDesc::GetAttr) .def("attr", &OpDesc::GetAttr)
.def("set_block_attr", &OpDesc::SetBlockAttr) .def("set_block_attr", &OpDesc::SetBlockAttr)
.def("set_serialized_attr", .def("set_serialized_attr",
[](OpDescBind &self, const std::string &name, [](OpDesc &self, const std::string &name,
const py::bytes &seriralized) { const py::bytes &seriralized) {
std::string ser(seriralized); std::string ser(seriralized);
self.SetAttr(name, ser); self.SetAttr(name, ser);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册