From 0a0b4caaa7cea5c2b205cc58cef08cdfb48de3c1 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 19 Jul 2017 13:07:28 +0800 Subject: [PATCH] Change Operator::create use py::bytes not std::string --- paddle/pybind/pybind.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/pybind/pybind.cc b/paddle/pybind/pybind.cc index e0f4c02459..7e84550f77 100644 --- a/paddle/pybind/pybind.cc +++ b/paddle/pybind/pybind.cc @@ -110,7 +110,7 @@ All parameter, weight, gradient are variables in Paddle. py::class_(m, "Operator") .def("__str__", &pd::OperatorBase::DebugString) .def_static("create", - [](const std::string& protobin) { + [](py::bytes protobin) { pd::OpDesc desc; PADDLE_ENFORCE(desc.ParsePartialFromString(protobin), "Cannot parse user input to OpDesc"); -- GitLab