Skip to content

Commit

Permalink
Remove deprecated Posterior.event_shape
Browse files Browse the repository at this point in the history
Summary: Deprecated since #1486

Differential Revision: D56799082
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Apr 30, 2024
1 parent 72db366 commit 89ca4bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
13 changes: 0 additions & 13 deletions botorch/posteriors/posterior.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from __future__ import annotations

import warnings

from abc import ABC, abstractmethod, abstractproperty
from typing import Optional, Tuple

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

@property
def event_shape(self) -> torch.Size:
r"""The event shape (i.e. the shape of a single sample)."""
warnings.warn(
"The `event_shape` attribute of `Posterior` is deprecated. It will default "
"to the `event_shape` of the underlying distribution in a future version. "
"Use `_extended_shape` instead.",
DeprecationWarning,
)
return self._extended_shape()

@abstractproperty
def device(self) -> torch.device:
r"""The torch device of the distribution."""
Expand Down
4 changes: 0 additions & 4 deletions test/posteriors/test_posterior.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ def test_posterior_list(self):
p_1 = make_posterior(shape, dtype)
p_2 = make_posterior(shape, dtype)
p = PosteriorList(p_1, p_2)
with self.assertWarnsRegex(
DeprecationWarning, "The `event_shape` attribute"
):
self.assertEqual(p.event_shape, p._extended_shape())
with self.assertRaisesRegex(NotImplementedError, "base_sample_shape"):
p.base_sample_shape
self.assertEqual(p._extended_shape(), shape + torch.Size([2]))
Expand Down

0 comments on commit 89ca4bf

Please sign in to comment.