Skip to content

Commit

Permalink
replace obj.copy() with copy.copy(obj) (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-z authored and williamFalcon committed Jan 17, 2020
1 parent bc67689 commit dac59bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/training_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def training_step(self, batch, batch_idx):
"""

import copy
import inspect
from abc import ABC, abstractmethod
import warnings
Expand Down Expand Up @@ -586,7 +586,7 @@ def training_forward(self, batch, batch_idx, opt_idx, hiddens):
gpu_id = 0
if isinstance(self.data_parallel_device_ids, list):
gpu_id = self.data_parallel_device_ids[0]
batch = self.transfer_batch_to_gpu(batch.copy(), gpu_id)
batch = self.transfer_batch_to_gpu(copy.copy(batch), gpu_id)
args[0] = batch
output = self.model.training_step(*args)

Expand Down

0 comments on commit dac59bb

Please sign in to comment.