Fix to cuda error
This commit is contained in:
@@ -172,6 +172,20 @@ def collate_to_cuda(device):
|
||||
return Xf, Xt, Y, Xc
|
||||
return _collate
|
||||
|
||||
def collate_to_cpu(batch):
|
||||
Xf, Xt, Y, Xc = zip(*batch)
|
||||
|
||||
Xf = torch.stack(Xf).cpu()
|
||||
Xt = torch.stack(Xt).cpu()
|
||||
Y = torch.stack(Y).cpu()
|
||||
|
||||
if Xc[0] is not None:
|
||||
Xc = torch.stack(Xc).cpu()
|
||||
else:
|
||||
Xc = None
|
||||
|
||||
return Xf, Xt, Y, Xc
|
||||
|
||||
|
||||
class EvenlySpacedDataset(BaseDataset):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user