// // SubGraphComplete.hpp // MNNConverter // // Created by MNN on 2020/06/24. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef MNN_CONVERTER_OPTIMIZER_SUBGRAPH_COMPLETE_HPP_ #define MNN_CONVERTER_OPTIMIZER_SUBGRAPH_COMPLETE_HPP_ #include "MNN/expr/Expr.hpp" #include #include #include #include namespace MNN { namespace Express { struct OptimizeContext { std::vector subgraphs; bool is_training; bool verbose; bool first_run = true; NetSource source; std::vector completed_subgraphs; using NetTPtr = std::unique_ptr; template using HashMap = std::unordered_map; // NetTPtr (*RunOptimize)(NetTPtr&, const HashMap&); std::function&)> RunOptimize; }; SubGraphProtoT* FindSubGraphByName( const std::vector& subgraphs, const std::string& subgraph_name); bool CompleteSubGraph(const std::unordered_map& inputs, const SubGraphProtoT* subgraph); } // namespace Express } // namespace MNN #endif // MNN_CONVERTER_OPTIMIZER_SUBGRAPH_COMPLETE_HPP_