def load_from_state_dict(
    model,
    state_dict,
    strict: bool = True,
    apply_filter: bool = True,
    num_splits: int = 0,
):
    """Loads the model weights from the state dictionary."""

    # step 1: filter state dict
    if apply_filter:
        state_dict = _filter_state_dict(state_dict)

    state_dict = _fix_projection_head_keys(state_dict)

    # step 2: expand batchnorm weights
    state_dict = _maybe_expand_batchnorm_weights(
        model.state_dict(), state_dict, num_splits
    )

    # step 3: load from checkpoint
    model.load_state_dict(state_dict, strict=strict)
Loads the model weights from the state dictionary.
lightly/cli/_helpers.py