def initialize_positional_embedding(
    pos_embedding: Parameter,
    strategy: str,
    num_prefix_tokens: int,
) -> None:
    """Initializes the positional embedding with the given strategy.

    Args:
        pos_embedding:
            Positional embedding parameter.
        strategy:
            Positional embedding initialization strategy. Valid options are:
            ['learn', 'sincos', 'skip']. 'learn' makes the embedding learnable,
            'sincos' creates a fixed 2D sine-cosine positional embedding, and 'skip'
            does not initialize the positional embedding.
        num_prefix_tokens:
            Number of prefix tokens in the positional embedding. This includes the class
            token.
    Raises:
        ValueError: If an invalid strategy is provided.
    """
    strategies = ["learn", "sincos", "skip"]

    # Validate the strategy
    if strategy not in strategies:
        raise ValueError(
            f"Invalid positional embedding strategy: '{strategy}'. Valid options are: "
            f"{strategies}."
        )

    # Initialize the positional embedding based on the startegy
    if strategy == "learn":
        initialize_learnable_positional_embedding(pos_embedding)
    elif strategy == "sincos":
        initialize_2d_sine_cosine_positional_embedding(
            pos_embedding=pos_embedding,
            has_class_token=num_prefix_tokens > 0,
        )
    elif strategy == "skip":
        return
Initializes the positional embedding with the given strategy.

    Args:
        pos_embedding:
            Positional embedding parameter.
        strategy:
            Positional embedding initialization strategy. Valid options are:
            ['learn', 'sincos', 'skip']. 'learn' makes the embedding learnable,
            'sincos' creates a fixed 2D sine-cosine positional embedding, and 'skip'
            does not initialize the positional embedding.
        num_prefix_tokens:
            Number of prefix tokens in the positional embedding. This includes the class
            token.
    Raises:
        ValueError: If an invalid strategy is provided.
    
lightly/models/utils.py