def test_sgpmc(self):
with self.test_context():
m = gpflow.models.SGPMC(
self.X, self.Y, self.kern,
likelihood=gpflow.likelihoods.StudentT(),
Z=self.X[::2])
m.compile()
m.X = self.rng.randn(*self.X.shape)
self.assertFalse(
m._needs_recompile,
msg="Recompilation should be avoided for the same shape data")
m.X = self.rng.randn(30, 1)
self.assertFalse(
m._needs_recompile,
After Change
def test_sgpmc(self):
with self.test_context():
X, Y, kern, rng = self.setup()
m = gpflow.models.SGPMC(X, Y, kern, likelihood=gpflow.likelihoods.StudentT(), Z=X[::2])
m.compile()
m.X = rng.randn(*X.shape)
with self.assertRaises(gpflow.GPflowError):