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

Method finish_callback

lite/pylite/test/test_network_device.py:216–227  ·  view source on GitHub ↗
(ios)

Source from the content-addressed store, hash-verified

214 finish_checked = False
215
216 def finish_callback(ios):
217 nonlocal finish_checked
218 finish_checked = True
219 assert len(ios) == 1
220 for key in ios:
221 io = key
222 data = ios[key].to_numpy().flatten()
223 output_data = self.correct_data.flatten()
224 assert data.size == output_data.size
225 for i in range(data.size):
226 assert data[i] == output_data[i]
227 return 0
228
229 network.set_finish_callback(finish_callback)
230 self.do_forward(network, 1)

Callers

nothing calls this directly

Calls 2

flattenMethod · 0.45
to_numpyMethod · 0.45

Tested by

no test coverage detected