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

Method check_correct

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

Source from the content-addressed store, hash-verified

76 input_data = np.load(input_data_path)
77
78 def check_correct(self, out_data, error=1e-4):
79 out_data = out_data.flatten()
80 assert np.isfinite(out_data.sum())
81 assert self.correct_data.size == out_data.size
82 for i in range(out_data.size):
83 assert abs(out_data[i] - self.correct_data[i]) < error
84
85 def do_forward(self, network, times=3):
86 input_name = network.get_input_name(0)

Callers 5

do_forwardMethod · 0.95
test_network_by_shareMethod · 0.45
test_network_asyncMethod · 0.45

Calls 4

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

Tested by

no test coverage detected