def test_single_state_single_input_sequential_model(self, compute_unit, dtype):
        """
        Tests for a model with a sequence of inplace ops.
        """

        def get_stateful_model():
            # fp32 state is not supported through runtime
            convert_to = "milinternal" if dtype == np.float32 else "mlprogram"
            compute_precision_mapping = {
                np.float16: ct.precision.FLOAT16,
                np.float32: ct.precision.FLOAT32,
            }
            model = ct.convert(
                float32_buffer_sequantial_model(),
                inputs=[
                    ct.TensorType(shape=(3,), dtype=dtype),
                ],
                states=[
                    ct.StateType(wrapped_type=ct.TensorType(shape=(3,), dtype=dtype), name="state"),
                ],
                minimum_deployment_target=ct.target.iOS18,
                compute_precision=compute_precision_mapping[dtype],
                convert_to=convert_to,
                compute_units=compute_unit,
            )

            if dtype == np.float32:
                return None, model
            assert dtype == np.float16
            return model, model._mil_program

        mlmodel, prog = get_stateful_model()
        assert get_op_types_in_program(prog) == [
            "read_state",
            "slice_update",
            "coreml_update_state",
            "mul",
            "mul",
            "coreml_update_state",
            "sub",
            "coreml_update_state",
            "relu",
        ]

        if mlmodel is not None:
            verify_prediction(mlmodel)

        Tests for a model with a sequence of inplace ops.
        
coremltools/converters/mil/frontend/torch/test/test_torch_stateful_model.py