mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 06:46:56 +08:00
Enhance pytorch nn (#917)
* enhance pytorch_nn * fix dim bug * Black format * Fix pylint error
This commit is contained in:
@@ -20,6 +20,9 @@ def experiment_exit_handler():
|
||||
The `atexit` handler should be put in the last, since, as long as the program ends, it will be called.
|
||||
Thus, if any exception or user interuption occurs beforehead, we should handle them first. Once `R` is
|
||||
ended, another call of `R.end_exp` will not take effect.
|
||||
|
||||
Limitations:
|
||||
- If pdb is used in the your program, excepthook will not be triggered when it ends. The status will be finished
|
||||
"""
|
||||
sys.excepthook = experiment_exception_hook # handle uncaught exception
|
||||
atexit.register(R.end_exp, recorder_status=Recorder.STATUS_FI) # will not take effect if experiment ends
|
||||
|
||||
Reference in New Issue
Block a user