Skip to content

Conversation

@DavidLapous
Copy link
Contributor

I noticed a significant increase in the loading time of my library (multipers) and tracing back the imports I ended up here.

The current issue is that if torch_found in the __init__.py, then the line

    from .torch.test_install import test_torch_bindings

will trigger the pykeops/torch/__init__.py, and load torch.

If we want to have a lazy load of torch, these functions thus need to be put outside this torch folder.

In this PR, I propose to do a new hidden module _test_install, and put the test_{stuff}_bindings here.
I also put the import torch inside the function to avoid importing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant