Skip to content

Commit 1f5e7bb

Browse files
committed
Change comment about autojit
1 parent c47c3b0 commit 1f5e7bb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

torchquad/integration/monte_carlo.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,15 @@ def get_jit_compiled_integrate(
129129
self._check_inputs(dim=dim, N=N, integration_domain=integration_domain)
130130
integration_domain = _setup_integration_domain(dim, integration_domain, backend)
131131
backend = infer_backend(integration_domain)
132-
# autoray's autojit function does JIT compilation, too, but in its
133-
# current version it does not abstract away the differences between
134-
# backends enough for our purposes,
135-
# e.g. with PyTorch the to-be-compiled function cannot have keyword
136-
# arguments and all its positional arguments are considered
137-
# to be variable inputs for the compiled function.
138-
# https://github.com/jcmgray/autoray/blob/35677037863d7d0d25ff025998d9fda75dce3b44/autoray/compiler.py
132+
# autoray's autojit function does JIT compilation, too.
133+
# We don't use it here for the following reasons:
134+
# * The way random number generators have to be included or excluded
135+
# from compilation differs between backends.
136+
# * autojit is not yet included in the latest autoray release
137+
# (which is version 0.2.5).
138+
# * It uses the deprecated experimental_compile argument with Tensorflow.
139+
# * Additional detach() calls against warnings with PyTorch are not yet
140+
# included in autojit.
139141
if backend == "tensorflow":
140142
if not hasattr(self, "_tf_jit_calculate_sample_points"):
141143
import tensorflow as tf

0 commit comments

Comments
 (0)