def test_eliminate_connected_outputs(self):
        """
        The optimization stops when the node is a block output
        """
        quantized_data = np.random.randint(0, 256, (2, 3, 4)).astype(np.int8)

        @mb.program(input_specs=[], opset_version=ct.target.iOS16)
        def prog():
            x = mb.constexpr_affine_dequantize(
                quantized_data=quantized_data,
                axis=0,
                scale=8.9,
                zero_point=np.int8(34),
            )
            x = mb.transpose(x=x, perm=(1, 0, 2))
            x = mb.reshape(x=x, shape=(2, 2, 3, 2))
            y = mb.transpose(x=x, perm=(0, 3, 2, 1))
            return x, y

        apply_pass_and_basic_check(prog, "common::merge_affine_dequantize_with_consecutive_ops")
        assert get_op_types_in_program(prog) == [
            "constexpr_affine_dequantize",
            "transpose",
        ]

        new_op = prog.find_ops(op_type="constexpr_affine_dequantize", exactly_one=True)[0]
        expected_quantized_data = np.transpose(quantized_data, (1, 0, 2))
        expected_quantized_data = np.reshape(expected_quantized_data, (2, 2, 3, 2))
        np.testing.assert_array_equal(new_op.quantized_data.val, expected_quantized_data)

        transpose_op = prog.find_ops(op_type="transpose", exactly_one=True)[0]
        assert transpose_op.perm.val.tolist() == [0, 3, 2, 1]

        The optimization stops when the node is a block output
        
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py