LLamaKvCacheViewSafeHandle
Namespace: LLama.Native
A safe handle for a LLamaKvCacheView
public class LLamaKvCacheViewSafeHandle : SafeLLamaHandleBase, System.IDisposable
Inheritance Object → CriticalFinalizerObject → SafeHandle → SafeLLamaHandleBase → LLamaKvCacheViewSafeHandle
Implements IDisposable
Properties
IsInvalid
public bool IsInvalid { get; }
Property Value
IsClosed
public bool IsClosed { get; }
Property Value
Constructors
LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle, LLamaKvCacheView)
Initialize a LLamaKvCacheViewSafeHandle which will call llama_kv_cache_view_free
when disposed
public LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle ctx, LLamaKvCacheView view)
Parameters
view
LLamaKvCacheView
Methods
Allocate(SafeLLamaContextHandle, Int32)
Allocate a new KV cache view which can be used to inspect the KV cache
public static LLamaKvCacheViewSafeHandle Allocate(SafeLLamaContextHandle ctx, int maxSequences)
Parameters
maxSequences
Int32
The maximum number of sequences visible in this view per cell
Returns
ReleaseHandle()
protected bool ReleaseHandle()
Returns
Update()
Update this view
public void Update()
GetView()
Get the raw KV cache view
public LLamaKvCacheView& GetView()