def test_binary_op_with_non_constant_input5(self):
        """
        Input graph:
                                                                input (shape=(3,4))
                                                                     |
        input (shape=(5,3,4,2)) --> transpose (shape=(5,2,3,4)) --> add --> transpose --> relu

        Output graph: same as input graph since transpose compliment for 2nd input of add cannot be represented
        as a static reshape
        """

        @mb.program(input_specs=[mb.TensorSpec(shape=(5, 3, 4, 2)), mb.TensorSpec(shape=(3, 4))])
        def prog(x, y):
            x = mb.transpose(x=x, perm=[0, 3, 1, 2])
            x = mb.add(x=x, y=y)
            x = mb.transpose(x=x, perm=[0, 2, 3, 1])
            x = mb.relu(x=x)
            return x

        prev_prog, prev_block, block = apply_pass_and_basic_check(prog, "common::reduce_transposes")
        self.assertEqual(
            get_op_types_in_program(prev_prog),
            ["transpose", "add", "transpose", "relu"],
        )
        self.assertEqual(
            get_op_types_in_program(prog),
            ["transpose", "add", "transpose", "relu"],
        )
        assert_model_is_valid(
            prog,
            {"x": (5, 3, 4, 2), "y": (3, 4)},
            expected_output_shapes={block.outputs[0].name: (5, 3, 4, 2)},
        )

        Input graph:
                                                                input (shape=(3,4))
                                                                     |
        input (shape=(5,3,4,2)) --> transpose (shape=(5,2,3,4)) --> add --> transpose --> relu

        Output graph: same as input graph since transpose compliment for 2nd input of add cannot be represented
        as a static reshape
        
coremltools/converters/mil/mil/passes/tests/test_reduce_transposes_pass.py