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

Method test_network_basic_mem

lite/pylite/test/test_network.py:504–521  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

502 os.remove(global_layout_transform_model)
503
504 def test_network_basic_mem(self):
505 network = LiteNetwork()
506 with open(self.model_path, "rb") as file:
507 network.load(file)
508
509 input_name = network.get_input_name(0)
510 input_tensor = network.get_io_tensor(input_name)
511 output_name = network.get_output_name(0)
512 output_tensor = network.get_io_tensor(output_name)
513
514 assert input_tensor.layout.shapes[0] == 1
515 assert input_tensor.layout.shapes[1] == 3
516 assert input_tensor.layout.shapes[2] == 224
517 assert input_tensor.layout.shapes[3] == 224
518 assert input_tensor.layout.data_type == LiteDataType.LITE_FLOAT
519 assert input_tensor.layout.ndim == 4
520
521 self.do_forward(network)
522
523
524class TestDiscreteInputNet(unittest.TestCase):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected