def test_tensor_state_inputs_interleave(
        self, float32_buffer_model_two_inputs_two_states, compute_unit
    ):
        """
        We allow the user to interleave tensor / state input types.
        """
        mlmodel = ct.convert(
            float32_buffer_model_two_inputs_two_states,
            inputs=[
                ct.TensorType(shape=(3,)),
                ct.TensorType(shape=(3,)),
            ],
            states=[
                ct.StateType(
                    wrapped_type=ct.TensorType(
                        shape=(3,),
                    ),
                    name="state_1",
                ),
                ct.StateType(
                    wrapped_type=ct.TensorType(
                        shape=(3,),
                    ),
                    name="state_2",
                ),
            ],
            minimum_deployment_target=ct.target.iOS18,
            convert_to="mlprogram",
            compute_units=compute_unit,
        )
        prog = mlmodel._mil_program
        assert get_op_types_in_program(prog) == [
            "read_state",
            "add",
            "coreml_update_state",
            "read_state",
            "add",
            "coreml_update_state",
            "mul",
        ]
        verify_prediction(mlmodel)

        We allow the user to interleave tensor / state input types.
        
coremltools/converters/mil/frontend/torch/test/test_torch_stateful_model.py