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

Function load_device_id

lite/test/test_network.cpp:1629–1641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1627}
1628
1629void load_device_id(
1630 LiteDeviceType device_type, int device_id, const std::string& model_path) {
1631 lite::Config config;
1632 config.device_type = device_type;
1633 auto network = std::make_shared<lite::Network>(config);
1634 network->set_device_id(device_id);
1635 network->load_model(model_path);
1636 std::shared_ptr<Tensor> input_tensor = network->get_input_tensor(0);
1637 std::shared_ptr<Tensor> output_tensor = network->get_output_tensor(0);
1638 network->forward();
1639 network->wait();
1640 ASSERT_EQ(output_tensor->get_device_id(), device_id);
1641}
1642} // namespace
1643#endif
1644

Callers 1

TESTFunction · 0.85

Calls 7

set_device_idMethod · 0.80
load_modelMethod · 0.45
get_input_tensorMethod · 0.45
get_output_tensorMethod · 0.45
forwardMethod · 0.45
waitMethod · 0.45
get_device_idMethod · 0.45

Tested by

no test coverage detected