def track_epoch_end_reduce_metrics(self, epoch_output, batch_end_outputs):
    hook_overridden = self._should_add_batch_output_to_epoch_output()
    for (opt_idx, opt_outputs) in enumerate(batch_end_outputs):
        sample_output = opt_outputs[(- 1)]
        auto_reduce_tng_result = (isinstance(sample_output, Result) and sample_output.should_reduce_on_epoch_end)
        if (not (hook_overridden or auto_reduce_tng_result)):
            continue
        if (isinstance(opt_outputs, list) and (len(opt_outputs) == 1) and (not isinstance(opt_outputs[0], Result))):
            opt_outputs = opt_outputs[0]
        epoch_output[opt_idx].append(opt_outputs)
def track_epoch_end_reduce_metrics(self, epoch_output, batch_end_outputs):
    hook_overridden = self._should_add_batch_output_to_epoch_output()
    for (opt_idx, opt_outputs) in enumerate(batch_end_outputs):
        sample_output = opt_outputs[(- 1)]
        auto_reduce_tng_result = (isinstance(sample_output, Result) and sample_output.should_reduce_on_epoch_end)
        if (not (hook_overridden or auto_reduce_tng_result)):
            continue
        if (isinstance(opt_outputs, list) and (len(opt_outputs) == 1) and (not isinstance(opt_outputs[0], Result))):
            opt_outputs = opt_outputs[0]
        epoch_output[opt_idx].append(opt_outputs)