def test_sequential_network_config_for_symmetric(mnist_model_quantization):
    """
    Tests a sequential network with multiple modules is configured correctly.
    This network has layers where input and output observers are shared. We test
    that for these layers, we set acitvation quantizer correctly for always affine layers
    """
    data = torch.randn(1, 1, 28, 28)
    prepared_model, quantizer = quantize_model(mnist_model_quantization, data)

    # verify module fusion
    assert isinstance(prepared_model.conv1, _qat.ConvBnAct2d)
    assert isinstance(prepared_model.conv2, _qat.ConvAct2d)
    assert isinstance(prepared_model.conv_transpose1, _qat.ConvTransposeBnAct2d)
    assert isinstance(prepared_model.conv_transpose2, _qat.ConvTransposeAct2d)
    assert isinstance(prepared_model.dense1, _qat.LinearAct)
    assert isinstance(prepared_model.dense2, _qat.LinearAct)

    # verify activation quantizers
    # after input
    assert prepared_model.activation_post_process_0.qscheme == torch.per_tensor_symmetric
    # after conv1
    assert prepared_model.activation_post_process_1.qscheme == torch.per_tensor_affine
    # after pool, this is shared with output of conv1
    assert id(prepared_model.activation_post_process_1) == id(prepared_model.activation_post_process_2)
    # after conv2
    assert prepared_model.activation_post_process_3.qscheme == torch.per_tensor_affine
    # after pool, shared with output of conv2
    assert id(prepared_model.activation_post_process_3) == id(prepared_model.activation_post_process_4)
    # after conv_transpose1
    assert prepared_model.activation_post_process_5.qscheme == torch.per_tensor_affine
    # after pool, shared with output of conv_transpose1
    assert id(prepared_model.activation_post_process_5) == id(
        prepared_model.activation_post_process_6
    )
    # after conv_transpose2
    assert prepared_model.activation_post_process_7.qscheme == torch.per_tensor_symmetric
    # after flatten, shared with the output of conv_transpose2
    assert id(prepared_model.activation_post_process_7) == id(
        prepared_model.activation_post_process_8
    )
    # after linear1
    assert prepared_model.activation_post_process_9.qscheme == torch.per_tensor_affine
    # after dropout
    # we remove activation post process after dropout layer
    assert not hasattr(prepared_model, "activation_post_process_10")
    # after linear2, logsoftmax
    assert prepared_model.activation_post_process_11.qscheme == torch.per_tensor_symmetric

    # convert model and test fusion
    converted_model = quantizer.finalize(inplace=False)

    # assert converted module fusion
    assert isinstance(converted_model.conv1, _quantized.QuantizedConvAct2d)
    assert isinstance(converted_model.conv2, _quantized.QuantizedConvAct2d)
    assert isinstance(converted_model.conv_transpose1, _quantized.QuantizedConvTransposeAct2d)
    assert isinstance(converted_model.conv_transpose2, _quantized.QuantizedConvTransposeAct2d)
    assert isinstance(converted_model.dense1, _quantized.QuantizedLinearAct)
    assert isinstance(converted_model.dense2, _quantized.QuantizedLinearAct)

    Tests a sequential network with multiple modules is configured correctly.
    This network has layers where input and output observers are shared. We test
    that for these layers, we set acitvation quantizer correctly for always affine layers
    
coremltools/test/optimize/torch/quantization/test_configure.py