We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd52b30 commit a2eb58aCopy full SHA for a2eb58a
tests/test_gpu.py
@@ -1,6 +1,7 @@
1
"""Test PCA with GPU and different dtypes."""
2
3
-# Copyright (c) 2024 Valentin Goldité. All Rights Reserved.
+# Copyright (c) 2024 Valentin Goldité. All Rights Reserved
4
+import pytest
5
import pytest_check as check
6
import torch
7
@@ -9,6 +10,8 @@
9
10
11
def test_gpu() -> None:
12
"""Test with GPU and different dtypes."""
13
+ if not torch.cuda.is_available():
14
+ pytest.skip("No GPU found.")
15
inputs = torch.load("tests/input_data.pt").to("cuda:0")
16
for dtype in [torch.float32, torch.float16, torch.float64]:
17
inputs = inputs.to(dtype)
0 commit comments