From 65f6cd432187f7947c30da3d2cd62009fa34f0d1 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 8 Jul 2019 20:11:43 -0400 Subject: [PATCH] removed dead code --- pytorch_lightning/models/trainer.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 5dedea54..597aa540 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -23,20 +23,6 @@ try: except ModuleNotFoundError: APEX_AVAILABLE = False - -def reduce_distributed_output(output, nb_gpus): - for k, v in output.items(): - # recurse on nested dics - if isinstance(output[k], dict): - output[k] = reduce_distributed_output(output[k], nb_gpus) - - # reduce only metrics that have the same nb of gpus - elif output[k].size(0) == nb_gpus: - reduced = torch.mean(output[k]) - output[k] = reduced - return output - - class Trainer(TrainerIO): def __init__(self, @@ -248,7 +234,6 @@ class Trainer(TrainerIO): # ----------------- if self.data_parallel: output = model(data_batch, batch_i) - # output = reduce_distributed_output(output, len(self.data_parallel_device_ids)) else: output = model.validation_step(data_batch, batch_i) @@ -598,7 +583,6 @@ class Trainer(TrainerIO): # return a scalar value and a dic with tqdm metrics if self.data_parallel: output = self.model(data_batch, batch_nb) - # output = reduce_distributed_output(output, len(self.data_parallel_device_ids)) else: output = self.model.training_step(data_batch, batch_nb)