Skip to content

Commit d99fa2f

Browse files
committed
get Sphinx documentation to build pytorch NNCG optimizer
1 parent 46e628e commit d99fa2f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

deepxde/optimizers/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
import importlib
2+
import os
23
import sys
34

45
from .config import LBFGS_options, set_LBFGS_options, NNCG_options, set_NNCG_options
56
from ..backend import backend_name
67

78

9+
# To get Sphinx documentation to build, we import all
10+
if os.environ.get("READTHEDOCS") == "True":
11+
# The backend should be tensorflow/tensorflow.compat.v1 to ensure backend.tf is not
12+
# None.
13+
from . import jax
14+
from . import paddle
15+
from . import pytorch
16+
from . import tensorflow
17+
from . import tensorflow_compat_v1
18+
19+
820
def _load_backend(mod_name):
921
mod = importlib.import_module(".%s" % mod_name, __name__)
1022
thismod = sys.modules[__name__]

0 commit comments

Comments
 (0)