Skip to content

Commit c048ace

Browse files
VilockLifacebook-github-bot
authored andcommitted
Fix the cuda test issue in GP with fidelity.
Summary: Fix the cuda test issue in GP with fidelity. Reviewed By: Balandat Differential Revision: D16072732 fbshipit-source-id: 392098252921b8e5d6968d499429ef84d4b16719
1 parent 280b8bd commit c048ace

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/models/fidelity/test_gp_regression_fidelity.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ def _get_model_and_data(
6969
model = SingleTaskMultiFidelityGP(**model_kwargs)
7070
return model, model_kwargs
7171

72-
def test_exception_message(self):
73-
train_X = torch.rand(20, 4)
72+
def test_exception_message(self, cuda=False):
73+
train_X = torch.rand(20, 4, device=torch.device("cuda" if cuda else "cpu"))
7474
train_Y = train_X.pow(2).sum(dim=-1)
75-
GP = SingleTaskMultiFidelityGP
7675
with self.assertRaises(UnsupportedError):
77-
GP(
76+
SingleTaskMultiFidelityGP(
7877
train_X,
7978
train_Y,
8079
train_iteration_fidelity=False,

0 commit comments

Comments
 (0)