def METHOD_NAME(backend: Backend, with_argmax: bool,
                               use_sigmoid: bool):
    check_backend(backend)
    config_path = 'tests/test_codebase/test_mmseg/data/model.py'
    model_cfg = mmengine.Config.fromfile(config_path)
    if use_sigmoid:
        import mmseg
        if version.parse(mmseg.__version__) <= version.parse('1.0.0'):
            pytest.skip('ignore mmseg<=1.0.0')
        model_cfg.model.decode_head.num_classes = 2
        model_cfg.model.decode_head.out_channels = 1
        model_cfg.model.decode_head.threshold = 0.3
    deploy_cfg = generate_mmseg_deploy_config(backend.value)
    deploy_cfg.codebase_config.with_argmax = with_argmax
    task_processor = generate_mmseg_task_processor(
        deploy_cfg=deploy_cfg, model_cfg=model_cfg)
    segmentor = task_processor.build_pytorch_model()
    size = 256
    inputs = torch.randn(1, 3, size, size)
    data_samples = [generate_datasample(size, size)]
    wrapped_model = WrapModel(
        segmentor, 'forward', data_samples=data_samples, mode='predict')
    model_outputs = wrapped_model(inputs)[0].pred_sem_seg.data
    rewrite_inputs = {
        'inputs': inputs,
    }
    rewrite_outputs, _ = get_rewrite_outputs(
        wrapped_model=wrapped_model,
        model_inputs=rewrite_inputs,
        deploy_cfg=deploy_cfg)
    rewrite_outputs = rewrite_outputs[0]
    if rewrite_outputs.shape[1] != 1:
        rewrite_outputs = rewrite_outputs.argmax(dim=1, keepdim=True)
    rewrite_outputs = rewrite_outputs.squeeze(0).to(model_outputs)
    assert torch.allclose(model_outputs, rewrite_outputs)