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

Function reset_max_memory_stats

imperative/python/megengine/device.py:232–240  ·  view source on GitHub ↗

r"""Resets the maximum stats on the computing device. Due to the asynchronous execution of MegEngine, please call megengine._full_sync before calling this function in order to properly reset memory stats.

(device: Optional[str] = None)

Source from the content-addressed store, hash-verified

230
231
232def reset_max_memory_stats(device: Optional[str] = None):
233 r"""Resets the maximum stats on the computing device.
234
235 Due to the asynchronous execution of MegEngine, please call megengine._full_sync
236 before calling this function in order to properly reset memory stats.
237 """
238 if device is None:
239 device = get_default_device()
240 CompNode.reset_max_memory_stats(device)
241
242
243def _make_free_mem_block_device(device: Optional[str] = None, size: int = 0):

Callers

nothing calls this directly

Calls 1

get_default_deviceFunction · 0.70

Tested by

no test coverage detected