Skip to content

Commit

Permalink
Copy batch for local forward (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
tullie authored and williamFalcon committed Nov 23, 2019
1 parent 55edf7c commit 48b797f
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 48b797f

Please sign in to comment.