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

Method encode

lite/load_and_run/src/helpers/utils.cpp:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55}
56std::string JsonOptionsCoder::encode(OptionValMap& option_val_map, bool encode_all) {
57 std::vector<std::pair<mgb::json::String, std::shared_ptr<mgb::json::Value>>>
58 json_options;
59 for (auto& item : option_val_map) {
60 encode_single_options(item, json_options, encode_all);
61 }
62
63 auto json_obj = mgb::json::Object::make(
64 {{"options", mgb::json::Object::make(json_options)}});
65
66 return json_obj->to_string(1);
67}
68
69//! encode device
70std::vector<std::shared_ptr<mgb::json::Object>> JsonOptionsCoder::encode(

Callers 15

process_fileFunction · 0.45
mainFunction · 0.45
set_next_optionsMethod · 0.45
get_curr_options_codeMethod · 0.45
get_jsonMethod · 0.45
__init__Method · 0.45
nameMethod · 0.45
get_io_tensorMethod · 0.45
get_discrete_tensorMethod · 0.45

Calls 10

encode_single_optionsFunction · 0.85
to_stringFunction · 0.85
StringClass · 0.70
makeFunction · 0.50
to_stringMethod · 0.45
get_typeMethod · 0.45
get_valueMethod · 0.45
get_defaultMethod · 0.45
push_backMethod · 0.45
type_stringMethod · 0.45

Tested by 3

test_decryptionMethod · 0.36
test_discrete_inputMethod · 0.36