Commit 3f89c29
Raise an error if
Summary:
Pull Request resolved: #1569
Say someone does the following bad thing:
> tf = Standardize(m=1)
> tf.untransform_posterior(posterior)
Old behavior:
- means and standard deviations are initialized in `Standarize.__init__` with a tensor of zeros, with 'device' not set
- With a posterior on the CPU, the posterior would be nonsensically untransformed with means and standard deviations of zero
- With a posterior on the GPU, this would cause an error about tensors on different devices, e.g. https://www.internalfb.com/diff/D42019721?dst_version_fbid=1618282175279712&selected_signal=dGVzdF9pZDo1NjI5NTAwMjcwNTY2NTk%3D&selected_signal_verification_phase=1
New behavior:
- means and standard deviations are initialized as None
- An informative error is raised
Reviewed By: saitcakmak, Balandat
Differential Revision: D42039100
fbshipit-source-id: f9585e2c32715216781651ebfcd8878d2e7e6971Standardize outcome transform's untransform_posterior is used without first calling the transform on outcomes (#1569)1 parent 76062a6 commit 3f89c29
File tree
2 files changed
+62
-10
lines changed- botorch/models/transforms
- test/models/transforms
2 files changed
+62
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
322 | 330 | | |
323 | 331 | | |
324 | 332 | | |
| |||
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
344 | 358 | | |
345 | 359 | | |
346 | 360 | | |
347 | 361 | | |
348 | 362 | | |
349 | | - | |
350 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
351 | 366 | | |
352 | 367 | | |
353 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
66 | 96 | | |
67 | 97 | | |
68 | 98 | | |
| |||
208 | 238 | | |
209 | 239 | | |
210 | 240 | | |
211 | | - | |
212 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
213 | 250 | | |
214 | 251 | | |
215 | 252 | | |
| |||
0 commit comments