def METHOD_NAME(self, runner):
    if runner.mode == 'train':
        epoch = runner.epoch + 1
    elif runner.mode == 'val':
        # normal val mode
        # runner.epoch += 1 has been done before val workflow
        epoch = runner.epoch
    else:
        raise ValueError(f"runner mode should be 'train' or 'val', "
                         f'but got {runner.mode}')
    return epoch