MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / createModule

Function createModule

test/plugins/wasmedge_tensorflow/wasmedge_tensorflow.cpp:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::unique_ptr<WasmEdge::Host::WasmEdgeTensorflowModule> createModule() {
30 using namespace std::literals::string_view_literals;
31 WasmEdge::Plugin::Plugin::load(std::filesystem::u8path(
32 "../../../plugins/wasmedge_tensorflow/" WASMEDGE_LIB_PREFIX
33 "wasmedgePluginWasmEdgeTensorflow" WASMEDGE_LIB_EXTENSION));
34 if (const auto *Plugin =
35 WasmEdge::Plugin::Plugin::find("wasmedge_tensorflow"sv)) {
36 if (const auto *Module = Plugin->findModule("wasmedge_tensorflow"sv)) {
37 return dynamicPointerCast<WasmEdge::Host::WasmEdgeTensorflowModule>(
38 Module->create());
39 }
40 }
41 return {};
42}
43} // namespace
44
45// TODO: add unit tests for every function.

Callers 1

TESTFunction · 0.70

Calls 3

loadFunction · 0.50
findModuleMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected