def rename_key(key):
    """Rename state_dict key."""

    # ResidualBlockWithStride: 'downsample' -> 'skip'
    if ".downsample.bias" in key or ".downsample.weight" in key:
        return key.replace("downsample", "skip")

    return key