Tensor.PermuteDimensions<T> Method

Definition

Swaps the dimensions of the tensor tensor according to the dimensions parameter. If tensor is a 1D tensor, it will return tensor. Otherwise it creates a new Tensor<T> with the new axis ordering by allocating new memory.

C#
public static System.Numerics.Tensors.Tensor<T> PermuteDimensions<T>(this System.Numerics.Tensors.Tensor<T> tensor, scoped ReadOnlySpan<int> dimensions);

Type Parameters

T

Parameters

tensor
Tensor<T>

Input Tensor<T>

dimensions
ReadOnlySpan<Int32>

ReadOnlySpan<T> with the new axis ordering.

Returns

Applies to

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