Skip to content

Commit 82fa50d

Browse files
saitcakmakfacebook-github-bot
authored andcommitted
Remove deprecated Posterior.event_shape
Summary: Deprecated since #1486 Reviewed By: Balandat Differential Revision: D56799082 fbshipit-source-id: 287e698529fed801974025874b5380b56ea76119
1 parent 0cb0aa1 commit 82fa50d

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

botorch/posteriors/posterior.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
from __future__ import annotations
1212

13-
import warnings
14-
1513
from abc import ABC, abstractmethod, abstractproperty
1614
from typing import Optional, Tuple
1715

@@ -84,17 +82,6 @@ def sample(self, sample_shape: Optional[torch.Size] = None) -> Tensor:
8482
with torch.no_grad():
8583
return self.rsample(sample_shape=sample_shape)
8684

87-
@property
88-
def event_shape(self) -> torch.Size:
89-
r"""The event shape (i.e. the shape of a single sample)."""
90-
warnings.warn(
91-
"The `event_shape` attribute of `Posterior` is deprecated. It will default "
92-
"to the `event_shape` of the underlying distribution in a future version. "
93-
"Use `_extended_shape` instead.",
94-
DeprecationWarning,
95-
)
96-
return self._extended_shape()
97-
9885
@abstractproperty
9986
def device(self) -> torch.device:
10087
r"""The torch device of the distribution."""

test/posteriors/test_posterior.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ def test_posterior_list(self):
7272
p_1 = make_posterior(shape, dtype)
7373
p_2 = make_posterior(shape, dtype)
7474
p = PosteriorList(p_1, p_2)
75-
with self.assertWarnsRegex(
76-
DeprecationWarning, "The `event_shape` attribute"
77-
):
78-
self.assertEqual(p.event_shape, p._extended_shape())
7975
with self.assertRaisesRegex(NotImplementedError, "base_sample_shape"):
8076
p.base_sample_shape
8177
self.assertEqual(p._extended_shape(), shape + torch.Size([2]))

0 commit comments

Comments
 (0)