1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
import torch_geometric.typing
from torch_geometric.testing import disableExtensions
def test_enable_extensions():
try:
import pyg_lib # noqa
assert torch_geometric.typing.WITH_PYG_LIB
except (ImportError, OSError):
assert not torch_geometric.typing.WITH_PYG_LIB
try:
import torch_scatter # noqa
assert torch_geometric.typing.WITH_TORCH_SCATTER
except (ImportError, OSError):
assert not torch_geometric.typing.WITH_TORCH_SCATTER
try:
import torch_sparse # noqa
assert torch_geometric.typing.WITH_TORCH_SPARSE
except (ImportError, OSError):
assert not torch_geometric.typing.WITH_TORCH_SPARSE
@disableExtensions
def test_disable_extensions():
assert not torch_geometric.typing.WITH_PYG_LIB
assert not torch_geometric.typing.WITH_TORCH_SCATTER
assert not torch_geometric.typing.WITH_TORCH_SPARSE
|