Class ArrayTensorExtensions
A static class that houses static DenseTensor{T} extension methods
Inheritance
Inherited Members
Namespace: Microsoft.ML.OnnxRuntime.Tensors
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public static class ArrayTensorExtensions
Methods
| Improve this Doc View SourceToTensor<T>(T[])
Creates a copy of this single-dimensional array as a DenseTensor<T>
Declaration
public static DenseTensor<T> ToTensor<T>(this T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to create a DenseTensor<T> from. |
Returns
Type | Description |
---|---|
DenseTensor<T> | A 1-dimensional DenseTensor<T> with the same length and content as |
Type Parameters
Name | Description |
---|---|
T | Type contained in the array to copy to the DenseTensor<T>. |
ToTensor<T>(T[,,,], Boolean)
Creates a copy of this four-dimensional array as a DenseTensor<T>
Declaration
public static DenseTensor<T> ToTensor<T>(this T[,,, ] array, bool reverseStride = false)
Parameters
Type | Name | Description |
---|---|---|
T[,,,] | array | The array to create a DenseTensor<T> from. |
Boolean | reverseStride | False (default) to indicate that the first dimension is most major (farthest apart) and the last dimension is most minor (closest together): akin to row-major in a rank-2 tensor. True to indicate that the last dimension is most major (farthest apart) and the first dimension is most minor (closest together): akin to column-major in a rank-2 tensor. |
Returns
Type | Description |
---|---|
DenseTensor<T> | A 4-dimensional DenseTensor<T> with the same dimensions and content as |
Type Parameters
Name | Description |
---|---|
T | Type contained in the array to copy to the DenseTensor<T>. |
ToTensor<T>(T[,,], Boolean)
Creates a copy of this three-dimensional array as a DenseTensor<T>
Declaration
public static DenseTensor<T> ToTensor<T>(this T[,, ] array, bool reverseStride = false)
Parameters
Type | Name | Description |
---|---|---|
T[,,] | array | The array to create a DenseTensor<T> from. |
Boolean | reverseStride | False (default) to indicate that the first dimension is most major (farthest apart) and the last dimension is most minor (closest together): akin to row-major in a rank-2 tensor. True to indicate that the last dimension is most major (farthest apart) and the first dimension is most minor (closest together): akin to column-major in a rank-2 tensor. |
Returns
Type | Description |
---|---|
DenseTensor<T> | A 3-dimensional DenseTensor<T> with the same dimensions and content as |
Type Parameters
Name | Description |
---|---|
T | Type contained in the array to copy to the DenseTensor<T>. |
ToTensor<T>(T[,], Boolean)
Creates a copy of this two-dimensional array as a DenseTensor<T>
Declaration
public static DenseTensor<T> ToTensor<T>(this T[, ] array, bool reverseStride = false)
Parameters
Type | Name | Description |
---|---|---|
T[,] | array | The array to create a DenseTensor<T> from. |
Boolean | reverseStride | False (default) to indicate that the first dimension is most major (farthest apart) and the last dimension is most minor (closest together): row-major. True to indicate that the last dimension is most major (farthest apart) and the first dimension is most minor (closest together): column-major. |
Returns
Type | Description |
---|---|
DenseTensor<T> | A 2-dimensional DenseTensor<T> with the same dimensions and content as |
Type Parameters
Name | Description |
---|---|
T | Type contained in the array to copy to the DenseTensor<T>. |
ToTensor<T>(Array, Boolean)
Creates a copy of this n-dimensional array as a DenseTensor<T>
Declaration
public static DenseTensor<T> ToTensor<T>(this Array array, bool reverseStride = false)
Parameters
Type | Name | Description |
---|---|---|
Array | array | The array to create a DenseTensor<T> from. |
Boolean | reverseStride | False (default) to indicate that the first dimension is most major (farthest apart) and the last dimension is most minor (closest together): akin to row-major in a rank-2 tensor. True to indicate that the last dimension is most major (farthest apart) and the first dimension is most minor (closest together): akin to column-major in a rank-2 tensor. |
Returns
Type | Description |
---|---|
DenseTensor<T> | A n-dimensional DenseTensor<T> with the same dimensions and content as |
Type Parameters
Name | Description |
---|---|
T | Type contained in the array to copy to the DenseTensor<T>. |