diff --git a/paddle/fluid/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc index b24c3546a3913b2f8d8eb7d150c06b8d9c191a91..a49e11aba685153f57c2e33ff7ef45fe84b5937b 100644 --- a/paddle/fluid/pybind/pybind.cc +++ b/paddle/fluid/pybind/pybind.cc @@ -1964,6 +1964,13 @@ All parameter, weight, gradient are variables in Paddle. } return ret_values; }); + m.def("get_all_op_names", []() { + std::vector op_names; + for (auto &iter : OpInfoMap::Instance().map()) { + op_names.emplace_back(iter.first); + } + return op_names; + }); m.def("get_op_attrs_default_value", [](py::bytes byte_name) -> paddle::framework::AttributeMap { std::string op_type = byte_name;