Tensor.AsTensorSpan<T>(T[], ReadOnlySpan<IntPtr>) 方法

定义

用于更轻松地从数组创建 TensorSpan 的扩展方法。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Tensors::TensorSpan<T> AsTensorSpan(cli::array <T> ^ array, ReadOnlySpan<IntPtr> lengths);
public static System.Numerics.Tensors.TensorSpan<T> AsTensorSpan<T> (this T[]? array, scoped ReadOnlySpan<IntPtr> lengths);
static member AsTensorSpan : 'T[] * ReadOnlySpan<nativeint> -> System.Numerics.Tensors.TensorSpan<'T>
<Extension()>
Public Function AsTensorSpan(Of T) (array As T(), lengths As ReadOnlySpan(Of IntPtr)) As TensorSpan(Of T)

类型参数

T

数组中元素的类型

参数

array
T[]

数据 Array

lengths

ReadOnlySpan<IntPtr>

ReadOnlySpan<nativeint>

TensorSpan<T> 的形状

返回

适用于