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

Method test_network_basic

lite/pylite/test/test_network_device.py:60–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58class TestNetwork(TestShuffleNetCuda):
59 @require_cuda()
60 def test_network_basic(self):
61 config = LiteConfig()
62 config.device_type = LiteDeviceType.LITE_CUDA
63 network = LiteNetwork(config)
64 network.load(self.model_path)
65
66 input_name = network.get_input_name(0)
67 input_tensor = network.get_io_tensor(input_name)
68 output_name = network.get_output_name(0)
69 output_tensor = network.get_io_tensor(output_name)
70
71 assert input_tensor.layout.shapes[0] == 1
72 assert input_tensor.layout.shapes[1] == 3
73 assert input_tensor.layout.shapes[2] == 224
74 assert input_tensor.layout.shapes[3] == 224
75 assert input_tensor.layout.data_type == LiteDataType.LITE_FLOAT
76 assert input_tensor.layout.ndim == 4
77
78 self.do_forward(network)
79
80 @require_cuda()
81 def test_network_shared_data(self):

Callers

nothing calls this directly

Calls 7

loadMethod · 0.95
get_input_nameMethod · 0.95
get_io_tensorMethod · 0.95
get_output_nameMethod · 0.95
LiteNetworkClass · 0.85
LiteConfigClass · 0.50
do_forwardMethod · 0.45

Tested by

no test coverage detected