Tensor.AsReadOnlyTensorSpan<T>(T[], ReadOnlySpan<IntPtr>) Method

Definition

Extension method to more easily create a TensorSpan from an array.

C#
public static System.Numerics.Tensors.ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan<T>(this T[]? array, scoped ReadOnlySpan<IntPtr> lengths);

Type Parameters

T

The type of the elements in the array

Parameters

array
T[]

The Array with the data

lengths

ReadOnlySpan<IntPtr>

The shape for the TensorSpan<T>

Returns

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)