-
Notifications
You must be signed in to change notification settings - Fork 584
Adding support for load_state_dict with assign=True for priors of Transformed distributions #2691
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
base: main
Are you sure you want to change the base?
Conversation
6ce060b to
5c174a1
Compare
| # Prefix for buffered attributes in TransformedDistributions. | ||
| # These are copies of the base distribution attributes, enabling state_dict | ||
| # save/load since the original attributes are properties and cannot be bufferized. | ||
| BUFFERED_PREFIX = "_buffered_" |
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.
would changing this from _transformed_ to __buffered__ cause issues with backward compatibility of loading a state dict?
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.
Not sure if this would be a big deal, it's probably not super widely used so I think we could merge this even if this breaks BC.
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.
Yes, it would unfortunately.
dfa1d23 to
1b777f8
Compare
2ff825a to
e35b828
Compare
Required changes in GPytorch to unblock meta-pytorch/botorch#3080. When
load_state_dictis called withassign=True,setattris called on_transformedattributes of the prior at the pytorch level.This was not the intended use of the
_transformedattribute, but it seems like we have to enable its modification directly.