-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add a comment that explains why the Classifier chain clears Variable attribues. #5069
Add a comment that explains why the Classifier chain clears Variable attribues. #5069
Conversation
Thank you for the PR! How about putting the explanation into the docstring of the class |
5904c33
to
ea18ad2
Compare
@mitmul Sorry for late reply. I moved the comment to a note on docstrings (with change of wordings). |
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.
LGTM
Welcome back! Jenkins, test this please |
Jenkins CI test (for commit ea18ad2, target branch master) failed with status FAILURE. |
Jenkins, test this please. |
Jenkins CI test (for commit ea18ad2, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Jenkins CI test (for commit ea18ad2, target branch master) succeeded! |
LGTM |
This PR makes the Classifier chain better explains the importance to clear the Variable attirubtes. It prevents sloppy users defines their own chain that consumes unnecessary memory.
The docstring of
chainer.links.model.Classifier
says:So it is reasnoable to assume that users often view and modify the source to define a custom chain. In fact, such a double memory allocation bug has actually happend in a project I'm work for.