From 28dee2265c38f783c5d9870aecc87a2f7fd0ddb6 Mon Sep 17 00:00:00 2001 From: lululxvi Date: Fri, 3 Jan 2025 21:33:10 -0500 Subject: [PATCH] get Sphinx documentation to build all optimizers --- deepxde/optimizers/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deepxde/optimizers/__init__.py b/deepxde/optimizers/__init__.py index 556761a86..2f669ae76 100644 --- a/deepxde/optimizers/__init__.py +++ b/deepxde/optimizers/__init__.py @@ -5,6 +5,17 @@ from ..backend import backend_name +# To get Sphinx documentation to build, we import all +if os.environ.get("READTHEDOCS") == "True": + # The backend should be tensorflow/tensorflow.compat.v1 to ensure backend.tf is not + # None. + from . import jax + from . import paddle + from . import pytorch + from . import tensorflow + from . import tensorflow_compat_v1 + + def _load_backend(mod_name): mod = importlib.import_module(".%s" % mod_name, __name__) thismod = sys.modules[__name__]