def on_train_epoch_end(self, trainer, pl_module):
    if (self.monitor == 'val_early_stop_on'):
        return
    should_check_early_stop = False
    train_es_key = 'early_stop_on'
    if (trainer.callback_metrics.get(train_es_key, None) is not None):
        self.monitor = train_es_key
        should_check_early_stop = True
    if should_check_early_stop:
        self._run_early_stopping_check(trainer, pl_module)
def on_train_epoch_end(self, trainer, pl_module):
    if (self.monitor == 'val_early_stop_on'):
        return
    should_check_early_stop = False
    train_es_key = 'early_stop_on'
    if (trainer.callback_metrics.get(train_es_key, None) is not None):
        self.monitor = train_es_key
        should_check_early_stop = True
    if should_check_early_stop:
        self._run_early_stopping_check(trainer, pl_module)