-
Notifications
You must be signed in to change notification settings - Fork 176
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
use_local_updates in optimizer #468
Conversation
[merging once all tests pass] |
Codecov Report
@@ Coverage Diff @@
## master #468 +/- ##
==========================================
+ Coverage 83.12% 83.71% +0.58%
==========================================
Files 81 81
Lines 8061 8063 +2
==========================================
+ Hits 6701 6750 +49
+ Misses 1360 1313 -47
|
tests/test_optimizer.py
Outdated
assert not optimizer.tracker.is_alive() | ||
assert optimizer.grad_averager is None if use_local_updates else (not optimizer.grad_averager.is_alive()) |
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.
Better to split the conditional in multiple lines:
tests/test_optimizer.py
Outdated
assert not optimizer.tracker.is_alive() | ||
assert optimizer.grad_averager is None if use_local_updates else (not optimizer.grad_averager.is_alive()) |
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.
assert optimizer.grad_averager is None if use_local_updates else (not optimizer.grad_averager.is_alive()) | |
if use_local_updates: | |
assert optimizer.grad_averager is None | |
else: | |
assert not optimizer.grad_averager.is_alive() |
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.
[implemented it as requested, but did not notice the suggestion
tests/test_optimizer.py
Outdated
( | ||
True, | ||
True, | ||
False, | ||
False, | ||
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.
To make formatting more consistent, you can surround the entire block of cases above with # fmt: off
and # fmt: on
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.
did as requested, thx for suggestion
[this PR fixes some edge case bugs introduced since 1.1.0, those bugs do not affect pip version]