We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b8ee44 commit f0d3abeCopy full SHA for f0d3abe
deepxde/backend/pytorch/tensor.py
@@ -16,7 +16,10 @@
16
# An alternative way is to use GPU by default if GPU is available, which is similar to
17
# TensorFlow.
18
if torch.cuda.is_available():
19
- torch.set_default_tensor_type(torch.cuda.FloatTensor)
+ if Version(torch.__version__) >= Version("2.1.0"):
20
+ torch.set_default_device("cuda")
21
+ else:
22
+ torch.set_default_tensor_type(torch.cuda.FloatTensor)
23
24
25
lib = torch
0 commit comments