CallbackPrintTiming
- class odl.solvers.util.callback.CallbackPrintTiming(fmt='Time elapsed = {:<5.03f} s', step=1, cumulative=False, **kwargs)[source]
Bases:
CallbackCallback for printing the time elapsed since the previous iteration.
- __init__(fmt='Time elapsed = {:<5.03f} s', step=1, cumulative=False, **kwargs)[source]
Initialize a new instance.
Parameters
- fmtstring, optional
Formating that should be applied. The time is printed as
print(fmt.format(runtime))
where
runtimeis the runtime since the last iterate.- steppositive int, optional
Number of iterations between prints.
- cumulativeboolean, optional
Print the time since the initialization instead of the last call.
Other Parameters
- kwargs :
Key word arguments passed to the print function.