You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
## Motivation
Fixesmeta-pytorch#1639. The issue was that pickle uses `__getstate__` and `__setstate__` to save / load the objects. In `TorchPosterior`, `__getattr__` was taking precedence, so instead of calling `TorchPosterior.__set/getstate__` it was calling `self.distribution.__set/getstate__`. While loading the posterior, we start with a `TorchPosterior` that does not have any attributes --including `distribution`--, so calling `self.distribution` was leading to an infinite loop of calling `TorchPosterior` with `name=distribution` (since it calls `getattr(self.distribution, name)`).
Pull Request resolved: meta-pytorch#1644
Test Plan: Units.
Reviewed By: Balandat
Differential Revision: D42732823
Pulled By: saitcakmak
fbshipit-source-id: 20183a7d5368a1e92dc36cd9726d0caf33f791d5
0 commit comments