未验证 提交 5212682e 编写于 作者: W Wilber 提交者: GitHub

update get op func. test=develop (#3920)

上级 81774daf
...@@ -28,13 +28,7 @@ namespace paddle { ...@@ -28,13 +28,7 @@ namespace paddle {
namespace lite { namespace lite {
std::vector<std::string> GetAllOps() { std::vector<std::string> GetAllOps() {
const std::map<std::string, std::string> &op2path = return OpLiteFactory::Global().GetAllOps();
OpKernelInfoCollector::Global().GetOp2PathDict();
std::vector<std::string> res;
for (const auto &op : op2path) {
res.push_back(op.first);
}
return res;
} }
void Predictor::SaveModel(const std::string &dir, void Predictor::SaveModel(const std::string &dir,
......
...@@ -97,6 +97,14 @@ class OpLiteFactory { ...@@ -97,6 +97,14 @@ class OpLiteFactory {
return ss.str(); return ss.str();
} }
std::vector<std::string> GetAllOps() const {
std::vector<std::string> res;
for (const auto& op : op_registry_) {
res.push_back(op.first);
}
return res;
}
protected: protected:
std::map<std::string, std::function<std::shared_ptr<OpLite>()>> op_registry_; std::map<std::string, std::function<std::shared_ptr<OpLite>()>> op_registry_;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册