megengine.dtr.evictee_minimum_size

evictee_minimum_size = <property object>

Get or set the memory threshold of tensors in bytes. It can also be set to a string, whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and gigabyte(GB) units.

注解

Only tensors whose size exceeds this threshold will be added to the candidate set. A tensor that is not added to the candidate set will never be evicted during its lifetime.

实际案例

import megengine as mge
mge.dtr.evictee_minimum_size = "2MB"