Class FixedBufferOnnxValue
This is a legacy class that is kept for backward compatibility. Use OrtValue based API.
Represents an OrtValue with its underlying buffer pinned
Inheritance
System.Object
FixedBufferOnnxValue
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class FixedBufferOnnxValue : IDisposable
Methods
| Improve this Doc View SourceCreateFromMemory<T>(OrtMemoryInfo, Memory<T>, TensorElementType, Int64[], Int64)
This is a legacy class that is kept for backward compatibility. Use OrtValue based API.
Represents an OrtValue with its underlying buffer pinned
Declaration
public static FixedBufferOnnxValue CreateFromMemory<T>(OrtMemoryInfo memoryInfo, Memory<T> memory, TensorElementType elementType, long[] shape, long bytesSize)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
OrtMemoryInfo | memoryInfo | |
Memory<><T> | memory | |
TensorElementType | elementType | |
System.Int64[] | shape | |
System.Int64 | bytesSize |
Returns
Type | Description |
---|---|
FixedBufferOnnxValue |
Type Parameters
Name | Description |
---|---|
T |
CreateFromTensor<T>(Tensor<T>)
Creates a FixedBufferOnnxValue object from the tensor and pins its underlying buffer.
Declaration
public static FixedBufferOnnxValue CreateFromTensor<T>(Tensor<T> value)
Parameters
Type | Name | Description |
---|---|---|
Tensor<T> | value |
Returns
Type | Description |
---|---|
FixedBufferOnnxValue | a disposable instance of FixedBufferOnnxValue |
Type Parameters
Name | Description |
---|---|
T |
Dispose()
IDisposable implementation
Declaration
public void Dispose()
Dispose(Boolean)
IDisposable implementation
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true if invoked from Dispose() |