From 777d25192c6cdcf642929c916df2b9c5432422f5 Mon Sep 17 00:00:00 2001 From: yinon Date: Fri, 4 Aug 2023 12:51:42 +0000 Subject: [PATCH] pytorch - bugfix - explicitly assign tensor to var as .to() is not inplace operation --- freqtrade/freqai/torch/PyTorchModelTrainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqai/torch/PyTorchModelTrainer.py b/freqtrade/freqai/torch/PyTorchModelTrainer.py index dc34e8907..e7c4d53be 100644 --- a/freqtrade/freqai/torch/PyTorchModelTrainer.py +++ b/freqtrade/freqai/torch/PyTorchModelTrainer.py @@ -113,8 +113,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface): self.model.eval() for _, batch_data in enumerate(data_loader_dictionary[split]): 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)