Commit 63346cc
Fix prior deserialization for priors with buffered attributes (#5167)
Summary:
Pull Request resolved: #5167
The Ax JSON decoder's `botorch_component_from_json` strips the
`BUFFERED_PREFIX` from state_dict keys only for `TransformedDistribution`
subclasses. This misses priors like `BetaPrior` whose underlying
distribution (`Beta`) uses `property` descriptors delegating to an
internal `Dirichlet`, causing `_bufferize_attributes` to use the prefix.
Broaden the check from `TransformedDistribution` to
`(TransformedDistribution, Prior)` so all gpytorch priors with buffered
attributes deserialize correctly.
Reviewed By: sdaulton
Differential Revision: D100341242
fbshipit-source-id: 26b2a047b48d3e1fa9a1d4585eb90cdeb1f58b621 parent 89c2c67 commit 63346cc
2 files changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1072 | 1096 | | |
1073 | 1097 | | |
1074 | 1098 | | |
| |||
0 commit comments