def METHOD_NAME(minimal_state: State, model_cls, model_params, empty_logger: Logger, replace_convs: bool,
                           replace_linears: bool):
    model = model_cls(*model_params)
    state = create_state(minimal_state, model)
    if (isinstance(model, SimpleTransformerClassifier) or isinstance(model, HuggingFaceModel)) and replace_convs:
        pytest.skip('Skipping: NLP models do not contain conv layers.')
    algo_instance = create_algo_instance(replace_convs, replace_linears)
    num_conv_layers = module_surgery.count_module_instances(state.model, torch.nn.Conv2d)
    num_linear_layers = module_surgery.count_module_instances(state.model, torch.nn.Linear)
    algo_instance.apply(event=Event.INIT, state=state, logger=empty_logger)
    # Each Conv2d/Linear is either unmodified or replaced with a factorized version,
    # which contains two Conv2d/Linears submodules.
    if algo_instance.factorize_convs:
        num_factorized_layers = module_surgery.count_module_instances(state.model, FactorizedConv2d)
        num_non_factorized_layers = module_surgery.count_module_instances(state.model,
                                                                          torch.nn.Conv2d) - 2 * num_factorized_layers
        assert num_conv_layers == num_factorized_layers + num_non_factorized_layers
        assert num_factorized_layers > 0
    if algo_instance.factorize_linears:
        num_factorized_layers = module_surgery.count_module_instances(state.model, FactorizedLinear)
        num_non_factorized_layers = module_surgery.count_module_instances(state.model,
                                                                          torch.nn.Linear) - 2 * num_factorized_layers
        assert num_linear_layers == num_factorized_layers + num_non_factorized_layers
        assert num_factorized_layers > 0