From 9cb45a38108fcd33352bf8c645adc2a46c4b2218 Mon Sep 17 00:00:00 2001 From: yinon Date: Thu, 13 Jul 2023 15:37:50 +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 603e7ac12..e74b572fd 100644 --- a/freqtrade/freqai/torch/PyTorchModelTrainer.py +++ b/freqtrade/freqai/torch/PyTorchModelTrainer.py @@ -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)