def on_train_batch_end(self, epoch_output, batch_end_outputs, batch, batch_idx, dataloader_idx):
    batch_end_outputs = [opt_idx_out for opt_idx_out in batch_end_outputs if len(opt_idx_out)]
    processed_batch_end_outputs = TrainLoop._prepare_outputs(batch_end_outputs, batch_mode=True)
    self.trainer.call_hook('on_train_batch_end', processed_batch_end_outputs, batch, batch_idx, dataloader_idx)
    self.trainer.call_hook('on_batch_end')
    self.track_epoch_end_reduce_metrics(epoch_output, batch_end_outputs)
    self.trainer.logger_connector.on_train_batch_end()
def on_train_batch_end(self, epoch_output, batch_end_outputs, batch, batch_idx, dataloader_idx):
    batch_end_outputs = [opt_idx_out for opt_idx_out in batch_end_outputs if len(opt_idx_out)]
    processed_batch_end_outputs = TrainLoop._prepare_outputs(batch_end_outputs, batch_mode=True)
    self.trainer.call_hook('on_train_batch_end', processed_batch_end_outputs, batch, batch_idx, dataloader_idx)
    self.trainer.call_hook('on_batch_end')
    self.track_epoch_end_reduce_metrics(epoch_output, batch_end_outputs)
    self.trainer.logger_connector.on_train_batch_end()