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
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class OrtExternalAllocation : object
Constructors
| Improve this Doc View SourceOrtExternalAllocation(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
| Improve this Doc View SourceElementType
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 |