Skip to content

Commit a478cd7

Browse files
committed
no cuda tests if no cuda available
1 parent e8c4712 commit a478cd7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# NEW VERSION TUTORIAL
2+
# STEP 1 - CHANGE VERSION IN THIS FILE
3+
# STEP 2 - CREATE TAG WITH THAT VERSIOn
4+
# STEP 3 - PUSH TO GITHUB
5+
# STEP 4 - PUSH TAG TO GITHUB
6+
# STEP 5 - WAIT AND SEE THAT TESTS PASS ON GITHUB AND THAT IT DIDNT FIND ANOTHER REASON TO SKIP PIP
7+
18
[build-system]
29
requires = ["setuptools >= 61.0"]
310
build-backend = "setuptools.build_meta"

tests/test_identical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def _assert_identical_merge_closure(opt_fn: Callable, device, steps: int):
8989

9090
def _assert_identical_device(opt_fn: Callable, merge: bool, use_closure: bool, steps: int):
9191
"""checks that trajectories match on cpu and cuda."""
92+
if not torch.cuda.is_available(): return
9293
cpu, cpu_opt = _get_trajectory(opt_fn, _BOOTH_X0.clone().cpu(), merge=merge, use_closure=use_closure, steps=steps)
9394
cuda, cuda_opt = _get_trajectory(opt_fn, _BOOTH_X0.clone().cuda(), merge=merge, use_closure=use_closure, steps=steps)
9495
_compare_trajectories(cpu_opt, cpu, cuda_opt, cuda.to(cpu))

0 commit comments

Comments
 (0)