Skip to content

Commit 9142a1f

Browse files
committed
Copy batch for local forward
1 parent e22dea2 commit 9142a1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/trainer/train_loop_mixin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def training_forward(self, batch, batch_nb, opt_idx, hiddens):
290290
gpu_id = 0
291291
if type(self.data_parallel_device_ids) is list:
292292
gpu_id = self.data_parallel_device_ids[0]
293-
batch = self.transfer_batch_to_gpu(batch, gpu_id)
293+
batch = self.transfer_batch_to_gpu(batch.copy(), gpu_id)
294294
args[0] = batch
295295
output = self.model.training_step(*args)
296296

0 commit comments

Comments
 (0)