Show / Hide Table of Contents

Class OrtExternalAllocation

This class represents an arbitrary buffer of memory allocated and owned by the user. It can be either a CPU, GPU or other device memory that can be suitably represented by IntPtr. This is just a composite of the buffer related information. The memory is assumed to be pinned if necessary and usable immediately in the native code.

Inheritance
System.Object
OrtExternalAllocation
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Microsoft.ML.OnnxRuntime
Assembly: cs.temp.dll.dll
Syntax
public class OrtExternalAllocation

Constructors

OrtExternalAllocation(OrtMemoryInfo, Int64[], TensorElementType, IntPtr, Int64)

Constructor

Declaration
public OrtExternalAllocation(OrtMemoryInfo memInfo, long[] shape, TensorElementType elementType, IntPtr pointer, long sizeInBytes)
Parameters
Type Name Description
OrtMemoryInfo memInfo

use to accurately describe a piece of memory that this is wrapping

System.Int64[] shape

shape of this buffer

TensorElementType elementType

element type

IntPtr pointer

the actual pointer to memory

System.Int64 sizeInBytes

size of the allocation in bytes

Properties

ElementType

Data type

Declaration
public TensorElementType ElementType { get; }
Property Value
Type Description
TensorElementType

Info

OrtMemoryInfo

Declaration
public OrtMemoryInfo Info { get; }
Property Value
Type Description
OrtMemoryInfo

Pointer

Actual memory ptr

Declaration
public IntPtr Pointer { get; }
Property Value
Type Description
IntPtr

Shape

Shape

Declaration
public long[] Shape { get; }
Property Value
Type Description
System.Int64[]

Size

Size of the allocation in bytes

Declaration
public long Size { get; }
Property Value
Type Description
System.Int64
In This Article
Back to top