neural_compressor.strategy.random

The random tuning strategy.

Module Contents

Classes

RandomTuneStrategy

The random tuning strategy.

class neural_compressor.strategy.random.RandomTuneStrategy(model, conf, q_dataloader=None, q_func=None, eval_dataloader=None, eval_func=None, resume=None, q_hooks=None)

Bases: neural_compressor.strategy.strategy.TuneStrategy

The random tuning strategy.

next_tune_cfg()

Generate and yield the next tuning config by random searching in tuning space.

Random strategy is used to randomly choose quantization tuning configurations from the tuning space.

Yields:

tune_config (dict) – A dict containing the tuning configuration for quantization.