megengine.dtr.enable_sqrt_sampling

enable_sqrt_sampling = <property object>

Get or set whether sqrt sampling is allowed. Sqrt sampling means that given the size of the candidate set is N, only enumerate sqrt(N) tensors. When the number of tensors is very high, enabling this optimization will speed up the training.

实际案例

import megengine as mge
mge.dtr.enable_sqrt_sampling = True