Jaa


Tensor.Resize<T>(Tensor<T>, ReadOnlySpan<IntPtr>) Method

Definition

Creates a new Tensor<T>, allocates new memory, and copies the data from tensor. If the final shape is smaller all data after that point is ignored.

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)

Type Parameters

T

Parameters

tensor
Tensor<T>

Input Tensor<T>.

lengths

ReadOnlySpan<IntPtr>

ReadOnlySpan<nativeint>

ReadOnlySpan<T> of the desired new shape.

Returns

Applies to