deephyper.evaluator.profile#

deephyper.evaluator.profile(*args, **kwargs)[source]#

Decorator to use on a run_function to profile its execution-time and peak memory usage.

By default, only the run-time is measured, for example by using the decorator as follows:

@profile
def run(config):
    ...
    return y

If the memory argument is set to True, the memory usage is also measured, for example by using the decorator as follows:

@profile(memory=True)
def run(config):
    ...
    return y
Parameters:

memory (bool) – If True, the memory usage is measured. Defaults to False.

Returns:

a decorated function.

Return type:

function