moved sampler

This commit is contained in:
William Falcon
2019-07-08 18:55:05 -04:00
parent 3873850ad4
commit 31d9062b3a
+2 -1
View File
@@ -283,7 +283,6 @@ class Trainer(TrainerIO):
model, self.optimizers, opt_level=self.amp_level,
)
self.optimizers = optimizers
model.trainer = self
# when using gpus, first thing we do is spawn a new process between each worker
# applies to single gpu, multi-gpu and multi-nodes
@@ -385,6 +384,8 @@ class Trainer(TrainerIO):
if self.on_gpu:
ref_model = model.module
ref_model.trainer = self
# set local properties on the model
ref_model.on_gpu = self.on_gpu