未验证 提交 4b74178b 编写于 作者: C Chen Weihang 提交者: GitHub

Add get_op_names method for counting ops (#43831)

* add get_op_names api

* Update pybind.cc
上级 dfdcfb94
...@@ -1964,6 +1964,13 @@ All parameter, weight, gradient are variables in Paddle. ...@@ -1964,6 +1964,13 @@ All parameter, weight, gradient are variables in Paddle.
} }
return ret_values; return ret_values;
}); });
m.def("get_all_op_names", []() {
std::vector<std::string> op_names;
for (auto &iter : OpInfoMap::Instance().map()) {
op_names.emplace_back(iter.first);
}
return op_names;
});
m.def("get_op_attrs_default_value", m.def("get_op_attrs_default_value",
[](py::bytes byte_name) -> paddle::framework::AttributeMap { [](py::bytes byte_name) -> paddle::framework::AttributeMap {
std::string op_type = byte_name; std::string op_type = byte_name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册