def test_skip_passes_in_different_pipelines(self):
        """
        Some passes exist in different pipelines. For example, const_elimination is in both main
        and backend pipelines. If the user want to skip the const_elimination pass, we want to make
        sure both pipelines skip that pass.
        """
        model = self._get_test_model()
        example_input = torch.rand(1, 1, 28, 28)
        traced_model = torch.jit.trace(model, example_input)

        pipeline = ct.PassPipeline()
        pipeline.remove_passes(passes_names=["common::const_elimination"])
        model_converted = ct.convert(
            traced_model,
            inputs=[ct.TensorType(shape=example_input.shape)],
            convert_to="mlprogram",
            pass_pipeline=pipeline,
        )

        op_types = get_op_types_in_program(model_converted._mil_program, skip_const_ops=False)
        expected_counts = {
            "const": 26,
            "cast": 7,
            "conv": 1,
            "matmul": 1,
            "add": 1,
            "shape": 1,
            "slice_by_index": 2,
            "concat": 1,
            "reshape": 1,
            "leaky_relu": 1,
        }
        assert Counter(op_types) == expected_counts

        Some passes exist in different pipelines. For example, const_elimination is in both main
        and backend pipelines. If the user want to skip the const_elimination pass, we want to make
        sure both pipelines skip that pass.
        
coremltools/test/api/test_api_examples.py