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

Method do_forward

lite/pylite/test/test_network_device.py:43–55  ·  view source on GitHub ↗
(self, network, times=3)

Source from the content-addressed store, hash-verified

41 assert abs(out_data[i] - self.correct_data[i]) < error
42
43 def do_forward(self, network, times=3):
44 input_name = network.get_input_name(0)
45 input_tensor = network.get_io_tensor(input_name)
46 output_name = network.get_output_name(0)
47 output_tensor = network.get_io_tensor(output_name)
48
49 input_tensor.set_data_by_copy(self.input_data)
50 for i in range(times):
51 network.forward()
52 network.wait()
53
54 output_data = output_tensor.to_numpy()
55 self.check_correct(output_data)
56
57
58class TestNetwork(TestShuffleNetCuda):

Calls 8

check_correctMethod · 0.95
set_data_by_copyMethod · 0.80
get_input_nameMethod · 0.45
get_io_tensorMethod · 0.45
get_output_nameMethod · 0.45
forwardMethod · 0.45
waitMethod · 0.45
to_numpyMethod · 0.45

Tested by

no test coverage detected