Skip to content

Commit 7bcda4b

Browse files
committed
Require PyTorch>=2.0.0
1 parent d99fa2f commit 7bcda4b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ DeepXDE requires one of the following backend-specific dependencies to be instal
7474

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

deepxde/backend/pytorch/tensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import torch
55

66

7-
if Version(torch.__version__) < Version("1.9.0"):
8-
raise RuntimeError("DeepXDE requires PyTorch>=1.9.0.")
7+
if Version(torch.__version__) < Version("2.0.0"):
8+
raise RuntimeError("DeepXDE requires PyTorch>=2.0.0.")
99

1010
# To write device-agnostic (CPU or GPU) code, a common pattern is to first determine
1111
# torch.device and then use it for all the tensors.

docs/user/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DeepXDE requires one of the following backend-specific dependencies to be instal
1414

1515
- 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.
1616

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

@@ -124,7 +124,7 @@ Export ``DDE_BACKEND`` as ``pytorch`` to specify PyTorch backend. In addition, i
124124
.. code:: python
125125
126126
if torch.cuda.is_available():
127-
torch.set_default_tensor_type(torch.cuda.FloatTensor)
127+
torch.set_default_device("cuda")
128128
129129
JAX backend
130130
```````````

0 commit comments

Comments
 (0)