-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix for incorrect usage of detach(), cpu(), to() #6216
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6216 +/- ##
=======================================
- Coverage 93% 91% -2%
=======================================
Files 159 159
Lines 11360 11251 -109
=======================================
- Hits 10603 10257 -346
- Misses 757 994 +237 |
tchaton
left a comment
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.
Great catch !
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.
Dear @dvolgyes,
The Result object implements in-place operation. Therefore, your changes won't work.
Therefore, I returned self from to, and cpu functions.
Best,
T.C
|
@dvolgyes I have applied this to the remaining codebase, mind checkingng it... |
|
I see, thank you for the fix. |
|
I looked through, and it looks good to me. |
|
Codecov: I don't understand how could it be that low. Something got accidentally disabled? (Jumping from 80 percent to 20%) |
it just takes time till all tests are finished stat aggregated, so the faster is base pkg testing and full testing takes about 15-20min |
|
I see, thanks for the explanation. |
* Fix for incorrect detach/cpu calls (Lightning-AI#6214) * Fix incorrect use of detach(), to(), and cpu(), Lightning-AI#6214 * Fix incorrect use of detach() and cpu(), Lightning-AI#6214 * update pr * add typing * chlog * more... * revert on module * update on comments * revert changes on model Co-authored-by: tchaton <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* Fix for incorrect detach/cpu calls (Lightning-AI#6214) * Fix incorrect use of detach(), to(), and cpu(), Lightning-AI#6214 * Fix incorrect use of detach() and cpu(), Lightning-AI#6214 * update pr * add typing * chlog * more... * revert on module * update on comments * revert changes on model Co-authored-by: tchaton <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* Fix for incorrect detach/cpu calls (#6214) * Fix incorrect use of detach(), to(), and cpu(), #6214 * Fix incorrect use of detach() and cpu(), #6214 * update pr * add typing * chlog * more... * revert on module * update on comments * revert changes on model Co-authored-by: tchaton <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
What does this PR do?
If you use .detach()/to()/cpu(), you need to assign it to a new variable,
it does not change the source variable.
Fixes #6214
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃