Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Test failing when using DeepXDE #155

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/pde/deepxde_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import torch
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np

Expand All @@ -12,6 +11,10 @@ def deepxde_example():
https://deepxde.readthedocs.io/en/latest/demos/operator/poisson.1d.pideeponet.html
"""

# deepxde sets the device context internally, which can conflict with the testing setup, when dealing with different
# devices (i.e. GPU and CPU). To ensure that the correct device is set the dependency is isolated.
import deepxde as dde # noqa

# Poisson equation: -u_xx = f
def equation(x, y, f):
dy_xx = dde.grad.hessian(y, x)
Expand Down
5 changes: 4 additions & 1 deletion tests/pde/test_pideeponet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
import torch
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np
import continuiti as cti
Expand All @@ -15,6 +14,10 @@ def test_pideeponet():
https://deepxde.readthedocs.io/en/latest/demos/operator/poisson.1d.pideeponet.html
"""

# deepxde sets the device context internally, which can conflict with the testing setup, when dealing with different
# devices (i.e. GPU and CPU). To ensure that the correct device is set the dependency is isolated.
import deepxde as dde # noqa

# Poisson equation: -v_xx = f
mse = torch.nn.MSELoss()

Expand Down
Loading