Skip to content

Commit 5782c7a

Browse files
committed
test fix
1 parent 538f591 commit 5782c7a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/wyckoff_transformer/tests/test_adaln_conditioning.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ def test_forward_with_cond_returns_correct_shape(self):
152152
model = self._build_model(condition_dim=1)
153153
start = torch.tensor([0, 1, 2], dtype=torch.int64)
154154
cascade = [torch.tensor([[0, 1], [1, 0], [2, 0]], dtype=torch.int64)]
155-
cond = torch.tensor([[0.5], [-0.5], [1.5]], dtype=torch.float32)
155+
# Match the model's parameter dtype: torch.set_default_dtype may have been
156+
# changed by another test (e.g. MACE calculator init flips it to float64).
157+
cond = torch.tensor([[0.5], [-0.5], [1.5]], dtype=next(model.parameters()).dtype)
156158
out = model(start, cascade, padding_mask=None, prediction_head=0, cond=cond)
157159
# Output is the prediction head applied to the last token; shape [batch_size, num_classes]
158160
self.assertEqual(out.shape, (3, 3))

0 commit comments

Comments
 (0)