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

Method set_header

lite/src/pack_model/pack_model.cpp:220–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void ModelPacker::set_header(
221 std::string model_decryption_method, std::string info_decryption_method,
222 bool is_fast_run_cache) {
223 m_header.model_decryption_method = model_decryption_method;
224 m_header.info_decryption_method = info_decryption_method;
225 memset(&m_header.fb32, 0, sizeof(m_header.fb32));
226 m_header.fb32.is_fast_run_cache = is_fast_run_cache;
227 if (!m_info_data.empty()) {
228 std::string json_string(
229 static_cast<const char*>(static_cast<void*>(m_info_data.data())),
230 m_info_data.size());
231 auto info = nlohmann::json::parse(json_string);
232 m_header.name = info["name"];
233 }
234}
235
236void ModelPacker::pack_model() {
237 auto fb_header = m_fbs_helper->build_header();

Callers 2

config_model_internelMethod · 0.80

Calls 4

parseFunction · 0.85
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected