mindspore.runtime.reset_peak_memory_stats
- mindspore.runtime.reset_peak_memory_stats()[source]
Reset the "peak" stats tracked by memory manager.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore as ms >>> import numpy as np >>> from mindspore import Tensor, ops >>> ms.set_device("Ascend", 0) >>> a = Tensor(np.ones([1, 2]), ms.float32) >>> b = Tensor(np.ones([1, 2]), ms.float32) >>> c = ops.add(a, b).asnumpy() >>> print(ms.runtime.max_memory_reserved()) 1073741824 >>> print(ms.runtime.max_memory_allocated()) 1536 >>> ms.runtime.reset_peak_memory_stats() >>> print(ms.runtime.max_memory_reserved()) 0 >>> print(ms.runtime.max_memory_allocated()) 0