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

Method finish_callback

lite/pylite/test/test_network.py:365–376  ·  view source on GitHub ↗
(ios)

Source from the content-addressed store, hash-verified

363 finish_checked = False
364
365 def finish_callback(ios):
366 nonlocal finish_checked
367 finish_checked = True
368 assert len(ios) == 1
369 for key in ios:
370 io = key
371 data = ios[key].to_numpy().flatten()
372 output_data = self.correct_data.flatten()
373 assert data.size == output_data.size
374 for i in range(data.size):
375 assert abs(data[i] - output_data[i]) < 1e-5
376 return 0
377
378 network.set_finish_callback(finish_callback)
379 self.do_forward(network, 1)

Callers

nothing calls this directly

Calls 3

absFunction · 0.50
flattenMethod · 0.45
to_numpyMethod · 0.45

Tested by

no test coverage detected