def test_duplicate_output_vars(self):
        """
        Input graph:
                           |-> output_1
            input -> relu -|
                           |-> output_2

        Output graph:
                                                                   |-> output_1
            input -> cast(fp32->fp16) -> relu -> cast(fp16->fp32) -|
                                                                   |-> output_2
        """

        @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2))])
        def prog(x):
            relu1 = mb.relu(x=x)
            return relu1, relu1

        _, _, block = apply_pass_and_basic_check(
            prog, quantization.FP16ComputePrecision(op_selector=lambda op: True)
        )
        self.assertEqual(get_op_types_in_program(prog), ["cast", "relu", "cast"])

        assert_model_is_valid(
            prog,
            {"x": (1, 2)},
            expected_output_shapes={block.outputs[0].name: (1, 2), block.outputs[1].name: (1, 2)},
            backend=("mlprogram", "fp16"),
        )

        Input graph:
                           |-> output_1
            input -> relu -|
                           |-> output_2

        Output graph:
                                                                   |-> output_1
            input -> cast(fp32->fp16) -> relu -> cast(fp16->fp32) -|
                                                                   |-> output_2
        
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py