diff --git a/pykeops/pykeops/__init__.py b/pykeops/pykeops/__init__.py index 9d08d6e12..79329b7c8 100644 --- a/pykeops/pykeops/__init__.py +++ b/pykeops/pykeops/__init__.py @@ -98,10 +98,10 @@ def get_build_folder(): if numpy_found: - from .numpy.test_install import test_numpy_bindings + from ._test_install.numpy import test_numpy_bindings if torch_found: - from .torch.test_install import test_torch_bindings + from ._test_install.torch import test_torch_bindings # next line is to ensure that cache file for formulas is loaded at import from .common import keops_io diff --git a/pykeops/pykeops/_test_install/__init__.py b/pykeops/pykeops/_test_install/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pykeops/pykeops/numpy/test_install.py b/pykeops/pykeops/_test_install/numpy.py similarity index 100% rename from pykeops/pykeops/numpy/test_install.py rename to pykeops/pykeops/_test_install/numpy.py diff --git a/pykeops/pykeops/torch/test_install.py b/pykeops/pykeops/_test_install/torch.py similarity index 97% rename from pykeops/pykeops/torch/test_install.py rename to pykeops/pykeops/_test_install/torch.py index 541ec3231..97e05de47 100644 --- a/pykeops/pykeops/torch/test_install.py +++ b/pykeops/pykeops/_test_install/torch.py @@ -1,5 +1,3 @@ -import torch - from pykeops.common.utils import pyKeOps_Message formula = "SqNorm2(x - y)" @@ -11,6 +9,9 @@ def test_torch_bindings(): """ This function try to compile a simple keops formula using the pytorch binder. """ + + import torch + x = torch.arange(1, 10, dtype=torch.float32).view(-1, 3) y = torch.arange(3, 9, dtype=torch.float32).view(-1, 3) diff --git a/pykeops/setup.py b/pykeops/setup.py index d8154d91f..3f52c7a58 100644 --- a/pykeops/setup.py +++ b/pykeops/setup.py @@ -55,6 +55,7 @@ "pykeops.torch.cluster", "pykeops.torch.generic", "pykeops.torch.lazytensor", + "pykeops._test_install", ], package_data={ "pykeops": [