Skip to content

Commit 5a1b90b

Browse files
skip pytorch test if uninstalled
1 parent 2208c44 commit 5a1b90b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/test_bspot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import ot
88
import ot.bsp
99
import numpy as np
10+
import importlib.metadata
1011

1112

1213
def test_bsp_ot_exact_identity():
@@ -141,4 +142,6 @@ def test_bsp_ot_torch_backend():
141142
test_bsp_ot_identity_null_cost()
142143
test_bsp_ot_plan_merge_decrease()
143144
test_bsp_ot_relative_error()
144-
test_bsp_ot_torch_backend()
145+
146+
if importlib.util.find_spec("torch") is not None:
147+
test_bsp_ot_torch_backend()

0 commit comments

Comments
 (0)