EXARL Utils
Debugging, Timing, and Profiling
Function decorators are provided for debugging, timing, and profiling EXARL.
Debugger captures the function signature and return values.
Timer prints execution time in seconds.
- Either
line_profilerormemory_profilercan be used for profiling the code. Profiler can be selected in
learner_cfg.jsonor using the command line argument--profile.Options for profiling are
line,mem, ornone.
- Either
Function decorators can be used as shown below:
from utils.profile import *
@DEBUG
def my_func(*args, **kwargs):
...
@TIMER
def my_func(*args, **kwargs):
...
@PROFILE
def my_func(*args, **kwargs):
...
Profiling results are written to: results_dir + '/Profile/<line/memory>_profile.txt.