MCPcopy Create free account
hub / github.com/apache/tvm-ffi / LoadModuleFromBytes

Function LoadModuleFromBytes

src/ffi/extra/library_module.cc:89–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87};
88
89Module LoadModuleFromBytes(const std::string& kind, const Bytes& bytes) {
90 std::string loader_key = "ffi.Module.load_from_bytes." + kind;
91 const auto floader = tvm::ffi::Function::GetGlobal(loader_key);
92 if (!floader.has_value()) {
93 TVM_FFI_THROW(RuntimeError) << "Library binary was created using {" << kind
94 << "} but a loader of that name is not registered. "
95 << "Make sure to have runtime that registers " << loader_key;
96 }
97 return (*floader)(bytes).cast<Module>();
98}
99
100/*!
101 * \brief Process libary binary to recover binary-serialized modules

Callers 1

ProcessLibraryBinFunction · 0.85

Calls 1

has_valueMethod · 0.45

Tested by

no test coverage detected