Skip to content

Commit

Permalink
Revert PyTorch NNCG optimizer doc build; Try torch v2 for Sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
lululxvi committed Jan 4, 2025
1 parent 1b50276 commit 46e628e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
12 changes: 0 additions & 12 deletions deepxde/optimizers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import importlib
import os
import sys

from .config import LBFGS_options, set_LBFGS_options, NNCG_options, set_NNCG_options
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__]
Expand Down
1 change: 0 additions & 1 deletion deepxde/optimizers/pytorch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__all__ = ["get", "is_external_optimizer"]

from .nncg import NNCG # To get Sphinx documentation to build
from .optimizers import get, is_external_optimizer
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tensorflow>=2.7.0
# TensorFlow 2.x
tensorflow-probability>=0.11.0
# PyTorch
torch<2.0.0 # build fails on RTD with torch 2.0.0
torch
# PaddlePaddle
# https://paddle-wheel.bj.bcebos.com/develop/linux/linux-cpu-mkl-avx/paddlepaddle-0.0.0-cp38-cp38-linux_x86_64.whl
paddlepaddle==2.6.0
Expand Down

0 comments on commit 46e628e

Please sign in to comment.