共用方式為


Tensor.PermuteDimensions<T> 方法

定義

根據 dimensions 參數交換 tensor 張量維度。 如果 tensor 是 1D 張量,則會傳回 tensor。 否則,它會藉由配置新的記憶體,建立具有新座標軸排序的新 Tensor<T>

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Numerics::Tensors::Tensor<T> ^ PermuteDimensions(System::Numerics::Tensors::Tensor<T> ^ tensor, ReadOnlySpan<int> dimensions);
public static System.Numerics.Tensors.Tensor<T> PermuteDimensions<T> (this System.Numerics.Tensors.Tensor<T> tensor, scoped ReadOnlySpan<int> dimensions);
static member PermuteDimensions : System.Numerics.Tensors.Tensor<'T> * ReadOnlySpan<int> -> System.Numerics.Tensors.Tensor<'T>
<Extension()>
Public Function PermuteDimensions(Of T) (tensor As Tensor(Of T), dimensions As ReadOnlySpan(Of Integer)) As Tensor(Of T)

類型參數

T

參數

tensor
Tensor<T>

輸入 Tensor<T>

dimensions
ReadOnlySpan<Int32>

ReadOnlySpan<T> 新的座標軸排序。

傳回

適用於