LLamaSharp/docs/xmldocs/llama.native.llamakvcachevi...

2.5 KiB

LLamaKvCacheViewSafeHandle

Namespace: LLama.Native

A safe handle for a LLamaKvCacheView

public class LLamaKvCacheViewSafeHandle : SafeLLamaHandleBase, System.IDisposable

Inheritance ObjectCriticalFinalizerObjectSafeHandleSafeLLamaHandleBaseLLamaKvCacheViewSafeHandle
Implements IDisposable

Properties

IsInvalid

public bool IsInvalid { get; }

Property Value

Boolean

IsClosed

public bool IsClosed { get; }

Property Value

Boolean

Constructors

LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle, LLamaKvCacheView)

Initialize a LLamaKvCacheViewSafeHandle which will call llama_kv_cache_view_free when disposed

public LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle ctx, LLamaKvCacheView view)

Parameters

ctx SafeLLamaContextHandle

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

ctx SafeLLamaContextHandle

maxSequences Int32
The maximum number of sequences visible in this view per cell

Returns

LLamaKvCacheViewSafeHandle

ReleaseHandle()

protected bool ReleaseHandle()

Returns

Boolean

Update()

Update this view

public void Update()

GetView()

Get the raw KV cache view

public LLamaKvCacheView& GetView()

Returns

LLamaKvCacheView&