tfl.test_utils.TimeTracker

View source on GitHub

Class TimeTracker

Tracks time.

Keeps track of time spent in its scope and appends it to 'list_to_append' on exit from scope divided by 'num_steps' if provided.

Example:

training_step_times = [] with TimeTracker(training_step_times, num_steps=num_epochs): model.fit(... epochs=num_epochs ...) print np.median(training_step_times)

__init__

View source

__init__(
    list_to_append,
    num_steps=1
)

Initialize self. See help(type(self)) for accurate signature.

Methods

__enter__

View source

__enter__()

__exit__

View source

__exit__(
    unuesd_type,
    unuesd_value,
    unuesd_traceback
)