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

Method py_get

imperative/python/src/utils.cpp:446–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444 virtual bool support_dump_cache() { return get_impl()->support_dump_cache(); }
445
446 py::object py_get(std::string category, std::string key) {
447 auto value = get_impl()->get(category, {key.data(), key.size()});
448 if (value.valid()) {
449 return py::bytes(std::string((const char*)value->ptr, value->size));
450 } else {
451 return py::none();
452 }
453 }
454
455 void py_put(std::string category, std::string key, std::string value) {
456 get_impl()->put(

Callers

nothing calls this directly

Calls 4

getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected