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

Method build_header

lite/src/pack_model/pack_model.cpp:81–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81flatbuffers::Offset<ModelHeader> FbsHelper::build_header() {
82 flatbuffers::Offset<flatbuffers::String> name, info_decryption_method,
83 info_parse_method, model_decryption_method, info_cache_parse_method;
84 bool is_fast_run_cache;
85 if (m_model_header) {
86 auto&& header = m_model_header;
87 name = m_builder.CreateSharedString(header->name());
88 info_decryption_method =
89 m_builder.CreateSharedString(header->info_decryption_method());
90 info_parse_method = m_builder.CreateSharedString(header->info_parse_method());
91 model_decryption_method =
92 m_builder.CreateSharedString(header->model_decryption_method());
93 info_cache_parse_method =
94 m_builder.CreateSharedString(header->info_cache_parse_method());
95 is_fast_run_cache = header->is_fast_run_cache();
96 } else {
97 auto&& header = m_packer->m_header;
98 name = m_builder.CreateSharedString(header.name);
99 info_decryption_method =
100 m_builder.CreateSharedString(header.info_decryption_method);
101 info_parse_method = m_builder.CreateSharedString(header.info_parse_method);
102 model_decryption_method =
103 m_builder.CreateSharedString(header.model_decryption_method);
104 info_cache_parse_method =
105 m_builder.CreateSharedString(header.info_cache_parse_method);
106 is_fast_run_cache = header.fb32.is_fast_run_cache;
107 }
108 return CreateModelHeader(
109 m_builder, name, info_decryption_method, info_parse_method,
110 model_decryption_method, info_cache_parse_method, is_fast_run_cache);
111}
112
113flatbuffers::Offset<ModelData> FbsHelper::build_data() {
114 if (m_model_data) {

Callers 1

pack_modelMethod · 0.80

Calls 1

nameMethod · 0.45

Tested by

no test coverage detected