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

Function load_device_input

lite/test/test_network.cpp:1609–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607}
1608
1609void load_device_input(
1610 LiteDeviceType device_type, const std::string& model_path,
1611 const std::vector<std::string>& inputs) {
1612 lite::NetworkIO networkio;
1613 lite::IO input_data_io = {};
1614 input_data_io.name = inputs[0];
1615 input_data_io.is_host = false;
1616 networkio.inputs.emplace_back(input_data_io);
1617 lite::IO input_input0_io = {};
1618 input_input0_io.name = inputs[1];
1619 input_input0_io.is_host = false;
1620 networkio.inputs.emplace_back(input_input0_io);
1621 lite::Config config;
1622 config.device_type = device_type;
1623 auto network = std::make_shared<lite::Network>(config, networkio);
1624 network->load_model(model_path);
1625 network->forward();
1626 network->wait();
1627}
1628
1629void load_device_id(
1630 LiteDeviceType device_type, int device_id, const std::string& model_path) {

Callers 1

TESTFunction · 0.85

Calls 4

emplace_backMethod · 0.80
load_modelMethod · 0.45
forwardMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected