def bind_kv_io(self, io_binding: "IOBinding"):
        """Bind the cache tensors to the IO binding object.

        Past key-value tensors are bound as inputs and present key-value tensors are bound as outputs.
        Outputs are not pre-allocated and will be allocated dynamically by the session.

        :param io_binding: IOBinding object to bind the cache tensors.
        """
        for k, ort_value in self.cache.items():
            io_binding.bind_ortvalue_input(k, ort_value)
        for k in self.present_names:
            # let the output cache be allocated dynamically
            io_binding.bind_output(k, self.device, self.device_id)
Bind the cache tensors to the IO binding object.

        Past key-value tensors are bound as inputs and present key-value tensors are bound as outputs.
        Outputs are not pre-allocated and will be allocated dynamically by the session.

        :param io_binding: IOBinding object to bind the cache tensors.
        
examples/utils/kv_cache_utils.py