test means are allcose only on cuda
@@ -134,16 +134,12 @@ class TestSimpleGPRegression(unittest.TestCase):
if torch.cuda.is_available():
self.test_posterior_latent_gp_and_likelihood_without_optimization(cuda=True)
- def test_gp_posterior_mean_skip_variances_fast_cuda(self, cuda=False):
+ def test_gp_posterior_mean_skip_variances_fast_cuda(self):
if torch.cuda.is_available():
- self.test_gp_posterior_mean_skip_variances_fast(cuda=True)
-
- def test_gp_posterior_mean_skip_variances_fast(self, cuda=False):
- train_x, test_x, train_y, _ = self._get_data(cuda=cuda)
+ train_x, test_x, train_y, _ = self._get_data(cuda=True)
likelihood = GaussianLikelihood()
gp_model = ExactGPModel(train_x, train_y, likelihood)
- if cuda:
gp_model.cuda()
likelihood.cuda()
@@ -159,16 +155,12 @@ class TestSimpleGPRegression(unittest.TestCase):
self.assertTrue(torch.allclose(mean_skip_var, mean))
self.assertTrue(torch.allclose(mean_skip_var, likelihood_mean))
- def test_gp_posterior_mean_skip_variances_slow_cuda(self, cuda=False):
+ def test_gp_posterior_mean_skip_variances_slow_cuda(self):
if torch.cuda.is_available():
- self.test_gp_posterior_mean_skip_variances_slow(cuda=True)
-
- def test_gp_posterior_mean_skip_variances_slow(self, cuda=False):
- train_x, test_x, train_y, _ = self._get_data(cuda=cuda)
+ train_x, test_x, train_y, _ = self._get_data(cuda=True)
likelihood = GaussianLikelihood()
gp_model = ExactGPModel(train_x, train_y, likelihood)
- if cuda:
gp_model.cuda()
likelihood.cuda()
@@ -181,7 +173,6 @@ class TestSimpleGPRegression(unittest.TestCase):
mean_skip_var = gp_model(test_x).mean
mean = gp_model(test_x).mean
likelihood_mean = likelihood(gp_model(test_x)).mean
-
self.assertTrue(torch.allclose(mean_skip_var, mean))
self.assertTrue(torch.allclose(mean_skip_var, likelihood_mean))
