def test_remove_thousands_identity_transpose(self):

        """
               INPUT
                 |
                 v
                [t1]
                 |
                 v
                [t2]
                 |
                 v
                 .
                 .
                 .
                 |
                 v
               [t1000]
                 |
                 v
                RELU
        tk are all identity
        Remove a sequence of 1000 identity transpose
        """
        input_shape = (1, 10, 5)
        input_features = [("data", datatypes.Array(*input_shape))]
        output_features = [("out", None)]
        builder = neural_network.NeuralNetworkBuilder(
            input_features, output_features, disable_rank5_shape_mapping=True
        )

        num_layers = 1000
        input_name = "data"
        for i in range(num_layers):
            output_name = "layer_" + str(i) + "_output"
            name = "layer_" + str(i)
            builder.add_transpose(
                name=name,
                axes=[0, 1, 2],
                input_name=input_name,
                output_name=output_name,
            )
            input_name = output_name

        builder.add_activation(
            name="relu", non_linearity="RELU", input_name=input_name, output_name="out"
        )

        self._test_builder(builder, input_shape, 1)

               INPUT
                 |
                 v
                [t1]
                 |
                 v
                [t2]
                 |
                 v
                 .
                 .
                 .
                 |
                 v
               [t1000]
                 |
                 v
                RELU
        tk are all identity
        Remove a sequence of 1000 identity transpose
        
coremltools/converters/mil/backend/nn/passes/test_mlmodel_passes.py