From e11a561c128a894ce03bd07bd3985f55f74220f8 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 14 Dec 2017 17:06:25 +0800 Subject: [PATCH] update --- paddle/pybind/pybind.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paddle/pybind/pybind.cc b/paddle/pybind/pybind.cc index c16d3e0cbe0..9ea4e70a262 100644 --- a/paddle/pybind/pybind.cc +++ b/paddle/pybind/pybind.cc @@ -282,6 +282,16 @@ All parameter, weight, gradient are variables in Paddle. } return ret_values; }); + m.def("get_grad_op_desc", + [](const OpDescBind &op_desc, + const std::unordered_set &no_grad_set, + std::unordered_map &grad_to_var, + const std::vector &grad_sub_block) { + return framework::OpInfoMap::Instance() + .Get(op_desc.Type()) + .GradOpMaker()(op_desc, no_grad_set, &grad_to_var, + grad_sub_block); + }); m.def("prune", [](const ProgramDescBind &origin, const std::vector> &targets) { ProgramDescBind prog_with_targets(origin); -- GitLab