|
12 | 12 | import torch |
13 | 13 | from botorch.exceptions import BotorchTensorDimensionError |
14 | 14 | from botorch.posteriors.gpytorch import GPyTorchPosterior, scalarize_posterior |
15 | | -from botorch.utils.testing import _get_test_posterior, BotorchTestCase, MockPosterior |
| 15 | +from botorch.utils.testing import _get_test_posterior, BotorchTestCase |
16 | 16 | from gpytorch import settings as gpt_settings |
17 | 17 | from gpytorch.distributions import MultitaskMultivariateNormal, MultivariateNormal |
18 | 18 | from linear_operator.operators import to_linear_operator |
|
25 | 25 |
|
26 | 26 |
|
27 | 27 | class TestGPyTorchPosterior(BotorchTestCase): |
28 | | - def test_GPyTorchPosterior(self): |
29 | | - # Test init & mvn property. |
30 | | - mock_mvn = MockPosterior() |
31 | | - with self.assertWarnsRegex(DeprecationWarning, "The `mvn` argument of"): |
32 | | - posterior = GPyTorchPosterior(mvn=mock_mvn) |
33 | | - self.assertIs(posterior.mvn, mock_mvn) |
34 | | - self.assertIs(posterior.distribution, mock_mvn) |
35 | | - with self.assertRaisesRegex(RuntimeError, "Got both a `distribution`"): |
36 | | - GPyTorchPosterior(mvn=mock_mvn, distribution=mock_mvn) |
37 | | - with self.assertRaisesRegex(RuntimeError, "GPyTorchPosterior must have"): |
38 | | - GPyTorchPosterior() |
39 | | - |
| 28 | + def test_GPyTorchPosterior(self) -> None: |
40 | 29 | for dtype in (torch.float, torch.double): |
41 | 30 | n = 3 |
42 | 31 | mean = torch.rand(n, dtype=dtype, device=self.device) |
|
0 commit comments