-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Should the Trainer attributes be protected? #1497
Comments
I agree that some shall be protected as well as some methods which are not meant to be used by user shall be protected too... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is marked as wontfix so it probably won't be done, but for the record that would be a very unusual behavior for Python, “we are all consenting adults here” and I don't think that a lib going out of its way to do that kind of thing would be a good thing. |
totally agree :) |
sorry for the confusion, it was an automatic bot marking non-active issues... |
Well, I was trying to argue that it should not be done, since it adds unnecessary complexity and makes it harder to monkey patch if needed :-) |
the point of protected is to clearly separate what is the recommended API and what is internal staff so you can still use it but to be aware that you are using something that is meant to be just internal PL use and you need to know how to use it correctly... so it does not add any complexity, all functions/classes stay as they are just minor rename with |
Right, that makes sense, sorry for being dense :-) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
❓ Why are the Trainer attributes not protected?
Sorry if this was already discussed before, but I was wondering.
Currently, the following code works and doesn't complain:
Is there a reason why attributes like these are not protected? For example this
would make the attribute read only and prevent anyone from accidentally changing the state of The trainer.
Is the callback system possibly the reason for this, so that the callback method has full access to trainer variables? If so, I feel a property + setter approach would still be better.
The text was updated successfully, but these errors were encountered: