Skip to content

Commit

Permalink
Copy batch for local forward
Browse files Browse the repository at this point in the history
  • Loading branch information
tullie committed Nov 18, 2019
1 parent e22dea2 commit 9142a1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/train_loop_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def training_forward(self, batch, batch_nb, opt_idx, hiddens):
gpu_id = 0
if type(self.data_parallel_device_ids) is list:
gpu_id = self.data_parallel_device_ids[0]
batch = self.transfer_batch_to_gpu(batch, gpu_id)
batch = self.transfer_batch_to_gpu(batch.copy(), gpu_id)
args[0] = batch
output = self.model.training_step(*args)

Expand Down

0 comments on commit 9142a1f

Please sign in to comment.