def on_batch_end(self, runner: "IRunner"):
        """Update tqdm progress bar at the end of each batch."""
        if runner.engine.process_index > 0:
            return
        batch_metrics = {k: float(v) for k, v in runner.batch_metrics.items()}
        self.tqdm.set_postfix(
            **{
                k: "{:3.3f}".format(v) if v > 1e-3 else "{:1.3e}".format(v)
                for k, v in sorted(batch_metrics.items())
            }
        )
        self.tqdm.update()
Update tqdm progress bar at the end of each batch.
catalyst/callbacks/misc.py