未验证 提交 586bafbd 编写于 作者: Z Zhanlue Yang 提交者: GitHub

Removed debug code (#37447)

上级 467099f0
...@@ -1628,15 +1628,10 @@ void BindImperative(py::module *m_ptr) { ...@@ -1628,15 +1628,10 @@ void BindImperative(py::module *m_ptr) {
"stop " "stop "
"gradient or without gradient.")); "gradient or without gradient."));
auto py_func = PyObjectCast<std::function<void()>>(hook.ptr()); auto py_func = PyObjectCast<std::function<void()>>(hook.ptr());
VLOG(1) << 111;
auto grad_node = self.MutableGradVarBase()->GradNode(); auto grad_node = self.MutableGradVarBase()->GradNode();
VLOG(1) << 222;
VLOG(1) << (grad_node == nullptr);
for (auto &cur_op : *grad_node) { for (auto &cur_op : *grad_node) {
VLOG(1) << 333;
cur_op.AddVoidFunctionPostHook( cur_op.AddVoidFunctionPostHook(
std::make_shared<std::function<void()>>(py_func)); std::make_shared<std::function<void()>>(py_func));
VLOG(1) << 444;
} }
}) })
.def("_register_backward_hook", .def("_register_backward_hook",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册