-
Notifications
You must be signed in to change notification settings - Fork 92
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Current points and newly generated samples are always stored on the CPU, causing issues whenever the chosen accelerator is different.
RuntimeError: Expected all tensors to be on the same deviceAdditionally, the docstring is not aligned with PINA conventions, and some variable names are not informative, making debugging more difficult.
To Reproduce
from pina.problem.zoo import Poisson2DSquareProblem
from pina.callback import R3Refinement
from pina.model import FeedForward
from pina.solver import PINN
from pina import Trainer
# Problem
problem = Poisson2DSquareProblem()
problem.discretise_domain(n=10)
# Model and Solver
model = FeedForward(2, 1, 20, 2)
solver = PINN(problem, model)
# Callback and Trainer
callback = R3Refinement(sample_every=10)
trainer = Trainer(solver, callbacks=callback, accelerator="gpu", max_epochs=25)
trainer.train()Expected behavior
All tensors should consistently be moved to and kept on the same device as the selected accelerator.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working