def test_single_fixed_qparams_act_for_symmetric(config, activation_fn, layer_and_data, bn):
    """
    Tests that when qscheme is symmetric, the qparams of fixed qparam ops are maintained
    """
    layer, data = layer_and_data
    if (isinstance(layer, nn.Conv2d) or isinstance(layer, nn.ConvTranspose2d)) and bn is not None:
        model = nn.Sequential(
            OrderedDict(
                {
                    "layer": layer,
                    "bn": bn,
                    "act": activation_fn(),
                }
            )
        )
    else:
        model = nn.Sequential(OrderedDict({
            'layer': layer,
            'act': activation_fn(),
        }))

    prepared_model, _ = quantize_model(model, data, config)

    builder = _QConfigMappingBuilder()
    qconfig = builder.get_default_qconfig_mapping(
        QuantizationScheme.symmetric,
        config.global_config,
    ).object_type_qconfigs[activation_fn]

    assert prepared_model.activation_post_process_1.scale == qconfig.activation().scale
    assert prepared_model.activation_post_process_1.zero_point == qconfig.activation().zero_point

    Tests that when qscheme is symmetric, the qparams of fixed qparam ops are maintained
    
coremltools/test/optimize/torch/quantization/test_configure.py