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

Method check_correct

lite/pylite/test/test_global.py:21–26  ·  view source on GitHub ↗
(self, out_data, error=1e-4)

Source from the content-addressed store, hash-verified

19 input_data = np.load(input_data_path)
20
21 def check_correct(self, out_data, error=1e-4):
22 out_data = out_data.flatten()
23 assert np.isfinite(out_data.sum())
24 assert self.correct_data.size == out_data.size
25 for i in range(out_data.size):
26 assert abs(out_data[i] - self.correct_data[i]) < error
27
28 def do_forward(self, network, times=3):
29 input_name = network.get_input_name(0)

Callers 1

do_forwardMethod · 0.95

Calls 4

absFunction · 0.50
flattenMethod · 0.45
isfiniteMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected