Show / Hide Table of Contents

Class OrtLoraAdapter

Represents Lora Adapter in memory

Inheritance
object
CriticalFinalizerObject
SafeHandle
OrtLoraAdapter
Implements
IDisposable
Inherited Members
SafeHandle.handle
SafeHandle.Close()
SafeHandle.DangerousAddRef(ref bool)
SafeHandle.DangerousGetHandle()
SafeHandle.DangerousRelease()
SafeHandle.Dispose()
SafeHandle.Dispose(bool)
SafeHandle.SetHandle(nint)
SafeHandle.SetHandleAsInvalid()
SafeHandle.IsClosed
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class OrtLoraAdapter : SafeHandle, IDisposable

Properties

| Improve this Doc View Source

IsInvalid

Overrides SafeHandle.IsInvalid

Declaration
public override bool IsInvalid { get; }
Property Value
Type Description
bool

returns true if handle is equal to Zero

Overrides
SafeHandle.IsInvalid

Methods

| Improve this Doc View Source

Create(byte[], OrtAllocator)

Creates an instance of OrtLoraAdapter from an array of bytes. The API makes a copy of the bytes internally.

Declaration
public static OrtLoraAdapter Create(byte[] bytes, OrtAllocator ortAllocator)
Parameters
Type Name Description
byte[] bytes

array of bytes containing valid LoraAdapter format

OrtAllocator ortAllocator

optional device allocator or null

Returns
Type Description
OrtLoraAdapter

new instance of LoraAdapter

| Improve this Doc View Source

Create(string, OrtAllocator)

Creates an instance of OrtLoraAdapter from file. The adapter file is memory mapped. If allocator parameter is provided, then lora parameters are copied to the memory allocated by the specified allocator.

Declaration
public static OrtLoraAdapter Create(string adapterPath, OrtAllocator ortAllocator)
Parameters
Type Name Description
string adapterPath

path to the adapter file

OrtAllocator ortAllocator

optional allocator, can be null, must be a device allocator

Returns
Type Description
OrtLoraAdapter

New instance of LoraAdapter

| Improve this Doc View Source

ReleaseHandle()

Overrides SafeHandle.ReleaseHandle() to properly dispose of the native instance of OrtLoraAdapter

Declaration
protected override bool ReleaseHandle()
Returns
Type Description
bool

always returns true

Overrides
SafeHandle.ReleaseHandle()

Implements

IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top