Tensor.Resize<T>(Tensor<T>, ReadOnlySpan<IntPtr>) 方法

定义

创建新的 Tensor<T>,分配新的内存,并从 tensor复制数据。 如果最后一个形状在忽略该点后的所有数据都较小。

public:
generic <typename T>
 static System::Numerics::Tensors::Tensor<T> ^ Resize(System::Numerics::Tensors::Tensor<T> ^ tensor, ReadOnlySpan<IntPtr> lengths);
public static System.Numerics.Tensors.Tensor<T> Resize<T> (System.Numerics.Tensors.Tensor<T> tensor, ReadOnlySpan<IntPtr> lengths);
static member Resize : System.Numerics.Tensors.Tensor<'T> * ReadOnlySpan<nativeint> -> System.Numerics.Tensors.Tensor<'T>
Public Function Resize(Of T) (tensor As Tensor(Of T), lengths As ReadOnlySpan(Of IntPtr)) As Tensor(Of T)

类型参数

T

参数

tensor
Tensor<T>

输入 Tensor<T>

lengths

ReadOnlySpan<IntPtr>

ReadOnlySpan<nativeint>

所需新形状的 ReadOnlySpan<T>

返回

适用于