mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-06 14:20:24 +00:00
pytorch - bugfix - explicitly assign tensor to var as .to() is not inplace operation
This commit is contained in:
@@ -83,8 +83,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface):
|
||||
for i, batch_data in enumerate(data_loaders_dictionary["train"]):
|
||||
|
||||
xb, yb = batch_data
|
||||
xb.to(self.device)
|
||||
yb.to(self.device)
|
||||
xb = xb.to(self.device)
|
||||
yb = yb.to(self.device)
|
||||
yb_pred = self.model(xb)
|
||||
loss = self.criterion(yb_pred, yb)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user