pytorch - bugfix - explicitly assign tensor to var as .to() is not inplace operation
This commit is contained in:
@@ -113,8 +113,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface):
|
|||||||
self.model.eval()
|
self.model.eval()
|
||||||
for _, batch_data in enumerate(data_loader_dictionary[split]):
|
for _, batch_data in enumerate(data_loader_dictionary[split]):
|
||||||
xb, yb = batch_data
|
xb, yb = batch_data
|
||||||
xb.to(self.device)
|
xb = xb.to(self.device)
|
||||||
yb.to(self.device)
|
yb = yb.to(self.device)
|
||||||
|
|
||||||
yb_pred = self.model(xb)
|
yb_pred = self.model(xb)
|
||||||
loss = self.criterion(yb_pred, yb)
|
loss = self.criterion(yb_pred, yb)
|
||||||
|
|||||||
Reference in New Issue
Block a user