def _should_add_batch_output_to_epoch_output(self) -> bool:
    lightning_module = self.trainer.lightning_module
    if is_overridden('training_epoch_end', model=lightning_module):
        return True
    if is_overridden('on_train_epoch_end', model=lightning_module):
        model_hook_fx = getattr(lightning_module, 'on_train_epoch_end')
        if is_param_in_hook_signature(model_hook_fx, 'outputs'):
            return True
    return False
def _should_add_batch_output_to_epoch_output(self) -> bool:
    lightning_module = self.trainer.lightning_module
    if is_overridden('training_epoch_end', model=lightning_module):
        return True
    if is_overridden('on_train_epoch_end', model=lightning_module):
        model_hook_fx = getattr(lightning_module, 'on_train_epoch_end')
        if is_param_in_hook_signature(model_hook_fx, 'outputs'):
            return True
    return False