Skip to content

Commit

Permalink
Require PyTorch>=2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lululxvi committed Jan 4, 2025
1 parent d99fa2f commit 7bcda4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ DeepXDE requires one of the following backend-specific dependencies to be instal

- TensorFlow 1.x: [TensorFlow](https://www.tensorflow.org)>=2.7.0
- TensorFlow 2.x: [TensorFlow](https://www.tensorflow.org)>=2.3.0, [TensorFlow Probability](https://www.tensorflow.org/probability)>=0.11.0
- PyTorch: [PyTorch](https://pytorch.org)>=1.9.0
- PyTorch: [PyTorch](https://pytorch.org)>=2.0.0
- JAX: [JAX](https://jax.readthedocs.io), [Flax](https://flax.readthedocs.io), [Optax](https://optax.readthedocs.io)
- PaddlePaddle: [PaddlePaddle](https://www.paddlepaddle.org.cn/en)>=2.6.0

Expand Down
4 changes: 2 additions & 2 deletions deepxde/backend/pytorch/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import torch


if Version(torch.__version__) < Version("1.9.0"):
raise RuntimeError("DeepXDE requires PyTorch>=1.9.0.")
if Version(torch.__version__) < Version("2.0.0"):
raise RuntimeError("DeepXDE requires PyTorch>=2.0.0.")

# To write device-agnostic (CPU or GPU) code, a common pattern is to first determine
# torch.device and then use it for all the tensors.
Expand Down
4 changes: 2 additions & 2 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DeepXDE requires one of the following backend-specific dependencies to be instal

- For TensorFlow 2.16+ with Keras 3, refer to `the instruction <https://github.com/tensorflow/probability/releases/tag/v0.24.0>`_ for installing TensorFlow Probability.

- PyTorch: `PyTorch <https://pytorch.org>`_>=1.9.0
- PyTorch: `PyTorch <https://pytorch.org>`_>=2.0.0
- JAX: `JAX <https://jax.readthedocs.io>`_, `Flax <https://flax.readthedocs.io>`_, `Optax <https://optax.readthedocs.io>`_
- PaddlePaddle: `PaddlePaddle <https://www.paddlepaddle.org.cn/en>`_>=2.6.0

Expand Down Expand Up @@ -124,7 +124,7 @@ Export ``DDE_BACKEND`` as ``pytorch`` to specify PyTorch backend. In addition, i
.. code:: python
if torch.cuda.is_available():
torch.set_default_tensor_type(torch.cuda.FloatTensor)
torch.set_default_device("cuda")
JAX backend
```````````
Expand Down

0 comments on commit 7bcda4b

Please sign in to comment.