def step(self, epoch: int, **kwargs: Any):
        """
        Perform the appropriate action at the given iteration.

        Args:
            epoch (int): the current epoch, ranged in [0, max_epoch-1].
            kwargs (Any): extra data to save, same as in
                :meth:`Checkpointer.save`.
        """
        epoch = int(epoch)
        additional_state = {"epoch": epoch}
        additional_state.update(kwargs)
        if (epoch + 1) % self.period == 0 and epoch < self.max_epoch - 1:
            if additional_state["metric"] > self.best_metric:
                self.checkpointer.save(
                    "model_best", **additional_state
                )
                self.best_metric = additional_state["metric"]
            # Put it behind best model save to make last checkpoint valid
            self.checkpointer.save(
                "model_{:04d}".format(epoch), **additional_state
            )
        if epoch >= self.max_epoch - 1:
            if additional_state["metric"] > self.best_metric:
                self.checkpointer.save(
                    "model_best", **additional_state
                )
            self.checkpointer.save("model_final", **additional_state)

        Perform the appropriate action at the given iteration.

        Args:
            epoch (int): the current epoch, ranged in [0, max_epoch-1].
            kwargs (Any): extra data to save, same as in
                :meth:`Checkpointer.save`.
        
fastreid/utils/checkpoint.py