-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracks all outputs including TBPTT and multiple optimizers #2890
Conversation
Hello @williamFalcon! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-08-09 02:51:37 UTC |
Codecov Report
@@ Coverage Diff @@
## master #2890 +/- ##
======================================
Coverage 90% 90%
======================================
Files 79 79
Lines 7236 7328 +92
======================================
+ Hits 6530 6617 +87
- Misses 706 711 +5 |
try: | ||
sample_obj = opt_idx_outputs[0][0] if isinstance(opt_idx_outputs[0], list) else opt_idx_outputs[0] | ||
is_result_obj = len(epoch_output) > 0 and isinstance(sample_obj, Result) | ||
except IndexError as e: | ||
is_result_obj = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@williamFalcon I believe this can be improved. The problem I see here is that, if anywhere else, for example in Result, an IndexError occurs then it will propagate to here and be treated wrongly. I highly recommend not to use exception handling for these types of control flow problems, as it can make debugging a lot more painful searching for the real origin. See also #2266
Enables behavior that was previously not possible:
Finishes #2354
Fixes #2320