pub struct IKVCacheUpdateLayer { /* private fields */ }Expand description
! \class IKVCacheUpdateLayer
!
! \brief Layer that represents a KVCacheUpdate operation.
!
! The KVCacheUpdate layer is used to cache the key or value tensors for the attention mechanism.
! K and V use separate KVCacheUpdate layers.
!
! An IKVCacheUpdateLayer has three inputs (cache, update, writeIndices) and one output.
! In kLINEAR mode, for each batch element i, the layer copies the update tensor into the cache starting at
! position writeIndices[i]. Assuming no out-of-bounds writes occur, the operation for each sequence position
! s in [0, sequenceLength) is:
! \code
! output[i, :, writeIndices[i] + s, :] = update[i, :, s, :]
! \endcode
!
! The output performs in-place updates on the cache tensor, so they must share the same device memory address.
!
! \warning Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
!