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
object
OrtExternalAllocation
Inherited Members
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
[Obsolete("Create OrtValue over an arbitrary piece of memory and use it where appropriate.")]
public class OrtExternalAllocation

Constructors

| Improve this Doc View Source

OrtExternalAllocation(OrtMemoryInfo, long[], TensorElementType, nint, long)

Constructor

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

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

long[] shape

shape of this buffer

TensorElementType elementType

element type

nint pointer

the actual pointer to memory

long sizeInBytes

size of the allocation in bytes

Properties

| Improve this Doc View Source

ElementType

Data type

Declaration
public TensorElementType ElementType { get; }
Property Value
Type Description
TensorElementType
| Improve this Doc View Source

Info

OrtMemoryInfo

Declaration
public OrtMemoryInfo Info { get; }
Property Value
Type Description
OrtMemoryInfo
| Improve this Doc View Source

Pointer

Actual memory ptr

Declaration
public nint Pointer { get; }
Property Value
Type Description
nint
| Improve this Doc View Source

Shape

Shape

Declaration
public long[] Shape { get; }
Property Value
Type Description
long[]
| Improve this Doc View Source

Size

Size of the allocation in bytes

Declaration
public long Size { get; }
Property Value
Type Description
long
  • Improve this Doc
  • View Source
In This Article
Back to top