neural_compressor.common.utils.utility

Module Contents

Classes

LazyImport

Lazy import python module till use.

CpuInfo

CPU info collection.

Functions

singleton(cls)

Singleton decorator.

dump_elapsed_time([customized_msg])

Get the elapsed time for decorated functions.

set_random_seed(seed)

Set the random seed in config.

set_workspace(workspace)

Set the workspace in config.

set_resume_from(resume_from)

Set the resume_from in config.

set_tensorboard(tensorboard)

Set the tensorboard in config.

log_quant_execution(func)

neural_compressor.common.utils.utility.singleton(cls)[source]

Singleton decorator.

class neural_compressor.common.utils.utility.LazyImport(module_name)[source]

Lazy import python module till use.

class neural_compressor.common.utils.utility.CpuInfo[source]

CPU info collection.

neural_compressor.common.utils.utility.dump_elapsed_time(customized_msg='')[source]

Get the elapsed time for decorated functions.

Parameters:

customized_msg (string, optional) – The parameter passed to decorator. Defaults to None.

neural_compressor.common.utils.utility.set_random_seed(seed: int)[source]

Set the random seed in config.

neural_compressor.common.utils.utility.set_workspace(workspace: str)[source]

Set the workspace in config.

neural_compressor.common.utils.utility.set_resume_from(resume_from: str)[source]

Set the resume_from in config.

neural_compressor.common.utils.utility.set_tensorboard(tensorboard: bool)[source]

Set the tensorboard in config.