def test_optimize_zp0_quantize(self, quant_dtype, is_axis_present):
        """
        initial graph:
            input -> quantize(zero_point=0) -> dequantize(scale=1) -> output

        final graph:
            input -> quantize() -> dequantize(scale=1) -> output
        """

        SHAPE = (1, 3)

        rank = len(SHAPE)
        axis = np.random.randint(-rank, rank) if is_axis_present else None

        scale = np.random.rand(SHAPE[axis]) if is_axis_present else np.random.rand()

        zero_point = np.zeros(SHAPE[axis], dtype=quant_dtype) if is_axis_present else quant_dtype(0)

        @mb.program(input_specs=[mb.TensorSpec(shape=SHAPE)])
        def prog(x):
            quantized = mb.quantize(
                input=x,
                scale=scale,
                zero_point=zero_point,
                axis=axis,
                output_dtype=self.np_dtype_to_str(quant_dtype),
            )
            dequantized = mb.dequantize(
                input=quantized,
                scale=1.0,
            )
            return dequantized

        assert get_op_types_in_program(prog) == ["quantize", "dequantize"]
        quantize_op = prog.find_ops(op_type="quantize")[0]
        assert np.all(quantize_op.zero_point.val == 0)

        _, _, block = apply_pass_and_basic_check(prog, "common::nullify_redundant_quantization_zero_point")
        assert get_op_types_in_program(prog) == ["quantize", "dequantize"]
        quantize_op = prog.find_ops(op_type="quantize")[0]
        assert quantize_op.zero_point is None

        assert_model_is_valid(
            prog,
            {"x": SHAPE},
            minimum_deployment_target=ct.target.iOS17,
            backend=("mlprogram", "fp32"),
            expected_output_shapes={block.outputs[0].name: SHAPE},
        )

        initial graph:
            input -> quantize(zero_point=0) -> dequantize(scale=1) -> output

        final graph:
            input -> quantize() -> dequantize(scale=1) -> output
        
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py