def test_skip_0_scale(self):
        """
        Input graph:
            x -> quantize(eps) -> dequantize(eps) -|
                                                   |-> add -> dequantize -> output
            y -> quantize(eps) -> dequantize(eps) -|

        Nothing changes due to underflow scale
        """

        # consider anything underflows fp16 to be 0
        SHAPE = (1, 2)
        scale_x, zero_point_x, axis_x = np.float32(5e-8), None, None
        scale_y, zero_point_y, axis_y = np.float32(-5e-8), None, None
        scale_z, zero_point_z, axis_z = np.float32(0.8), None, None

        @mb.program(
            input_specs=[
                mb.TensorSpec(shape=SHAPE, dtype=types.fp32),
                mb.TensorSpec(shape=SHAPE, dtype=types.fp32),
            ]
        )
        def prog(x, y):
            # quantize input
            quantize_x = mb.quantize(
                input=x, scale=scale_x, zero_point=zero_point_x, axis=axis_x, output_dtype="uint8"
            )
            quantize_y = mb.quantize(
                input=y, scale=scale_y, zero_point=zero_point_y, axis=axis_y, output_dtype="uint8"
            )
            # quantized binary op
            dequantize_x = mb.dequantize(
                input=quantize_x, scale=scale_x, zero_point=zero_point_x, axis=axis_x
            )
            dequantize_y = mb.dequantize(
                input=quantize_y, scale=scale_y, zero_point=zero_point_y, axis=axis_y
            )
            z = mb.add(x=dequantize_x, y=dequantize_y)
            quantize_z = mb.quantize(
                input=z, scale=scale_z, zero_point=zero_point_z, axis=axis_z, output_dtype="uint8"
            )
            # dequantize output
            dequantize_z = mb.dequantize(
                input=quantize_z, scale=scale_z, zero_point=zero_point_z, axis=axis_z
            )
            return dequantize_z

        prev_prog, _, _ = apply_pass_and_basic_check(
            prog, "common::distributive_quantized_binary_op_scale_normalization"
        )

        scale_prev_dequantize_x = prev_prog.find_ops(op_type="dequantize")[0].scale.val
        scale_prev_dequantize_y = prev_prog.find_ops(op_type="dequantize")[1].scale.val
        scale_prev_quantize_z = prev_prog.find_ops(op_type="quantize")[-1].scale.val
        assert np.all(scale_prev_dequantize_x == scale_x)
        assert np.all(scale_prev_dequantize_y == scale_y)
        assert np.all(scale_prev_quantize_z == scale_z)

        scale_dequantize_x = prog.find_ops(op_type="dequantize")[0].scale.val
        scale_dequantize_y = prog.find_ops(op_type="dequantize")[1].scale.val
        scale_quantize_z = prog.find_ops(op_type="quantize")[-1].scale.val
        assert np.all(scale_dequantize_x == scale_x)
        assert np.all(scale_dequantize_y == scale_y)
        assert np.all(scale_quantize_z == scale_z)

        Input graph:
            x -> quantize(eps) -> dequantize(eps) -|
                                                   |-> add -> dequantize -> output
            y -> quantize(eps) -> dequantize(eps) -|

        Nothing changes due to underflow scale
        
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py