disable compilation py>=3.14
This commit is contained in:
committed by
Giovanni Canali
parent
24d806b262
commit
64930c431f
@@ -71,9 +71,7 @@ class PINNInterface(SupervisedSolverInterface, metaclass=ABCMeta):
|
||||
"""
|
||||
# Override the compilation, compiling only for torch < 2.8, see
|
||||
# related issue at https://github.com/mathLab/PINA/issues/621
|
||||
if torch.__version__ < "2.8":
|
||||
self.trainer.compile = True
|
||||
else:
|
||||
if torch.__version__ >= "2.8":
|
||||
self.trainer.compile = False
|
||||
warnings.warn(
|
||||
"Compilation is disabled for torch >= 2.8. "
|
||||
|
||||
@@ -174,11 +174,7 @@ class SolverInterface(lightning.pytorch.LightningModule, metaclass=ABCMeta):
|
||||
:return: The result of the parent class ``setup`` method.
|
||||
:rtype: Any
|
||||
"""
|
||||
if stage == "fit" and self.trainer.compile:
|
||||
self._setup_compile()
|
||||
if stage == "test" and (
|
||||
self.trainer.compile and not self._is_compiled()
|
||||
):
|
||||
if self.trainer.compile and not self._is_compiled():
|
||||
self._setup_compile()
|
||||
return super().setup(stage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user