From 0f84bb3655779c593b4973526d69e857337b0314 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Thu, 10 Aug 2017 18:58:18 +0800 Subject: [PATCH] Fix merge error --- paddle/framework/grad_op_builder.cc | 4 ++-- paddle/framework/pybind.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/framework/grad_op_builder.cc b/paddle/framework/grad_op_builder.cc index 27f37d99232..5f84eb8c15d 100644 --- a/paddle/framework/grad_op_builder.cc +++ b/paddle/framework/grad_op_builder.cc @@ -33,12 +33,12 @@ static void TransOpArg(const OperatorBase* src_op, OperatorBase* dst_op, auto& dst_inout = dst_type == OpArgType::IN ? dst_op->inputs_ : dst_op->outputs_; - const OpProto& proto = OpRegistry::protos().at(src_op->type_); + const OpProto& proto = OpProtos().at(src_op->type_); const auto& src_arg_list = src_type == OpArgType::IN ? proto.inputs() : proto.outputs(); for (const auto& arg : src_arg_list) { - std::string src_name = arg.name(); + const std::string& src_name = arg.name(); std::string dst_name = is_grad ? GradVarName(src_name) : src_name; for (auto& var_name : src_inout.at(src_name)) { std::string s = is_grad ? GradVarName(var_name) diff --git a/paddle/framework/pybind.cc b/paddle/framework/pybind.cc index e606751e1c3..173a701fa6f 100644 --- a/paddle/framework/pybind.cc +++ b/paddle/framework/pybind.cc @@ -154,7 +154,7 @@ All parameter, weight, gradient are variables in Paddle. //! @note: Be careful! PyBind will return std::string as an unicode, not //! Python str. If you want a str object, you should cast them in Python. m.def("get_all_op_protos", []() -> std::vector { - auto &protos = OpRegistry::protos(); + auto &protos = OpProtos(); std::vector ret_values; for (auto it = protos.begin(); it != protos.end(); ++it) { PADDLE_ENFORCE(it->second.IsInitialized(), -- GitLab