temporary fix for py37 (combinedloader) (#215)
* temporary fix for py37 (combinedloader)
This commit is contained in:
@@ -237,4 +237,4 @@ class SamplePointLoader:
|
||||
'output': self.batch_output_pts[idx_],
|
||||
'condition': self.batch_data_conditions[idx_],
|
||||
}
|
||||
yield d
|
||||
yield d
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
""" Module for GAROM """
|
||||
|
||||
import torch
|
||||
import sys
|
||||
try:
|
||||
from torch.optim.lr_scheduler import LRScheduler # torch >= 2.0
|
||||
except ImportError:
|
||||
@@ -251,7 +252,11 @@ class GAROM(SolverInterface):
|
||||
|
||||
for condition_id in range(condition_idx.min(), condition_idx.max()+1):
|
||||
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
if sys.version_info >= (3, 8):
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
else:
|
||||
condition_name = dataloader.loaders.condition_names[condition_id]
|
||||
|
||||
condition = self.problem.conditions[condition_name]
|
||||
pts = batch['pts'].detach()
|
||||
out = batch['output']
|
||||
|
||||
@@ -5,6 +5,7 @@ try:
|
||||
except ImportError:
|
||||
from torch.optim.lr_scheduler import _LRScheduler as LRScheduler # torch < 2.0
|
||||
|
||||
import sys
|
||||
from torch.optim.lr_scheduler import ConstantLR
|
||||
|
||||
from .solver import SolverInterface
|
||||
@@ -143,7 +144,10 @@ class PINN(SolverInterface):
|
||||
|
||||
for condition_id in range(condition_idx.min(), condition_idx.max()+1):
|
||||
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
if sys.version_info >= (3, 8):
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
else:
|
||||
condition_name = dataloader.loaders.condition_names[condition_id]
|
||||
condition = self.problem.conditions[condition_name]
|
||||
pts = batch['pts']
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
""" Module for SupervisedSolver """
|
||||
import torch
|
||||
import sys
|
||||
try:
|
||||
from torch.optim.lr_scheduler import LRScheduler # torch >= 2.0
|
||||
except ImportError:
|
||||
@@ -98,7 +99,10 @@ class SupervisedSolver(SolverInterface):
|
||||
|
||||
for condition_id in range(condition_idx.min(), condition_idx.max()+1):
|
||||
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
if sys.version_info >= (3, 8):
|
||||
condition_name = dataloader.condition_names[condition_id]
|
||||
else:
|
||||
condition_name = dataloader.loaders.condition_names[condition_id]
|
||||
condition = self.problem.conditions[condition_name]
|
||||
pts = batch['pts']
|
||||
out = batch['output']
|
||||
|
||||
Reference in New Issue
Block a user