Skip to content

Commit

Permalink
Disable TorchScript compilation when importing operations in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Sep 4, 2024
1 parent ab41dc2 commit 5318cae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@

import tomli # Replace by tomllib from std library once docs are build with Python 3.11

import metatrain


# When importing metatensor-torch, this will change the definition of the classes
# to include the documentation
os.environ["METATENSOR_IMPORT_FOR_SPHINX"] = "1"
os.environ["RASCALINE_IMPORT_FOR_SPHINX"] = "1"
# disable TorchScript compilation for metatensor-operations since they will fail with
# METATENSOR_IMPORT_FOR_SPHINX=1. Remove this when lab-cosmo/metatensor#728 is released.
os.environ["PYTORCH_JIT"] = "0"

import metatrain # noqa: E402


ROOT = os.path.abspath(os.path.join("..", ".."))

Expand Down

0 comments on commit 5318cae

Please sign in to comment.