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

定义

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

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

类型参数

T

数组中元素的类型

参数

array
T[]

数据 Array

lengths

ReadOnlySpan<IntPtr>

ReadOnlySpan<nativeint>

TensorSpan<T> 的形状

返回

适用于