MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / prase_model

Method prase_model

lite/src/network.cpp:78–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void Network::prase_model(std::shared_ptr<void> model_data, size_t size) {
79 std::unordered_map<std::string, LiteAny> separate_config_map;
80 ModelParser model_parser(model_data, size);
81 //! parse the model info
82 if (model_parser.parse_model_info(
83 m_config, m_network_io, separate_config_map, m_extra_info,
84 !m_extra_config.disable_configure_by_model_info)) {
85 if (m_config.backend == LiteBackend::LITE_DEFAULT &&
86 m_impl->get_backend_type() != LiteBackend::LITE_DEFAULT) {
87 m_impl.reset(try_call_func<NetworkImplDft, lite::Network::NetworkImplBase*>(
88 "parse_model"));
89 }
90 if (!m_extra_config.disable_configure_by_model_info) {
91 m_impl->set_config(m_config);
92 m_impl->set_io(m_network_io);
93 }
94 }
95 //! decryption the model
96 size_t model_length;
97 auto&& model_shared_ptr = model_parser.parse_model(model_length, m_config);
98
99 m_impl->load_model(model_shared_ptr, model_length, separate_config_map);
100 m_loaded = true;
101 update_from_implement();
102}
103
104Network::~Network() = default;
105

Callers

nothing calls this directly

Calls 7

parse_model_infoMethod · 0.80
set_configMethod · 0.80
set_ioMethod · 0.80
parse_modelMethod · 0.80
get_backend_typeMethod · 0.45
resetMethod · 0.45
load_modelMethod · 0.45

Tested by

no test coverage detected