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>

返回

适用于