def METHOD_NAME(minimal_state: State, model_cls, model_params, empty_logger: Logger, batch, replace_convs,
                       replace_linears):
    model = model_cls(*model_params)
    if (isinstance(model, SimpleTransformerClassifier) or isinstance(model, HuggingFaceModel)) and replace_convs:
        pytest.skip('Skipping: NLP models do not contain conv layers.')
    if isinstance(model, SimpleTransformerClassifier):
        pytest.xfail(
            'Factorize does not support torch.nn.MultiheadAttention layers, which are part of the SimpleTransformerClassifier.'
        )
    state = create_state(minimal_state, model)
    algo_instance = create_algo_instance(replace_convs, replace_linears)
    output = state.model.forward(batch)
    algo_instance.apply(event=Event.INIT, state=state, logger=empty_logger)
    new_output = state.model.forward(batch)
    if isinstance(model, HuggingFaceModel):
        assert output.logits.size() == new_output.logits.size()
    else:
        assert output.size() == new_output.size()