You need to sign in or sign up before continuing.
提交 0a0b4caa 编写于 作者: Y Yu Yang

Change Operator::create use py::bytes not std::string

上级 d3373c5b
...@@ -110,7 +110,7 @@ All parameter, weight, gradient are variables in Paddle. ...@@ -110,7 +110,7 @@ All parameter, weight, gradient are variables in Paddle.
py::class_<pd::OperatorBase, pd::OperatorPtr>(m, "Operator") py::class_<pd::OperatorBase, pd::OperatorPtr>(m, "Operator")
.def("__str__", &pd::OperatorBase::DebugString) .def("__str__", &pd::OperatorBase::DebugString)
.def_static("create", .def_static("create",
[](const std::string& protobin) { [](py::bytes protobin) {
pd::OpDesc desc; pd::OpDesc desc;
PADDLE_ENFORCE(desc.ParsePartialFromString(protobin), PADDLE_ENFORCE(desc.ParsePartialFromString(protobin),
"Cannot parse user input to OpDesc"); "Cannot parse user input to OpDesc");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册