Tensor<T>.MoveAxes Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3

Overload List

MoveAxes(Int32[]) Moves a set of axes to new positions in a tensor.
MoveAxes(ReadOnlySpan<Int32>) Moves a set of axes to new positions in a tensor.
MoveAxes(Int32[], Int32[]) Moves a set of axes to new positions in a tensor.
MoveAxes(ReadOnlySpan<Int32>, ReadOnlySpan<Int32>) Moves a set of axes to new positions in a tensor.

MoveAxes(Int32[])

Moves a set of axes to new positions in a tensor.
C#
public Tensor<T> MoveAxes(
	int[] axes
)

Parameters

axes  Int32[]
An array containing the desired new positions of the axes.

Return Value

Tensor<T>
A view of the tensor with the axes moved to the positions specified in axes.

Remarks

Negative values indicate the axis should be counted from the end.

The source and destination axes must each be unique.

Exceptions

ArgumentException

The axes specified by axes are not all unique.

MoveAxes(ReadOnlySpan<Int32>)

Moves a set of axes to new positions in a tensor.
C#
public abstract Tensor<T> MoveAxes(
	ReadOnlySpan<int> axes
)

Parameters

axes  ReadOnlySpan<Int32>
A read-only span containing the desired new positions of the axes.

Return Value

Tensor<T>
A view of the tensor with the axes moved to the positions specified in axes.

Remarks

Negative values indicate the axis should be counted from the end.

The source and destination axes must each be unique.

Exceptions

ArgumentException

The axes specified by axes are not all unique.

MoveAxes(Int32[], Int32[])

Moves a set of axes to new positions in a tensor.
C#
public Tensor<T> MoveAxes(
	int[] source,
	int[] destination
)

Parameters

source  Int32[]
An array containing the axes to move.
destination  Int32[]
An array containing the desired new positions of the axes.

Return Value

Tensor<T>
A view of the tensor with axes in source moved to the corresponding positions in destination.

Remarks

Negative values indicate the axis should be counted from the end.

The source and destination axes must each be unique.

Exceptions

DimensionMismatchException

source and destination do not have the same length.

ArgumentException

The axes specified by source are not all unique.

-or-

The axes specified by destination are not all unique.

MoveAxes(ReadOnlySpan<Int32>, ReadOnlySpan<Int32>)

Moves a set of axes to new positions in a tensor.
C#
public Tensor<T> MoveAxes(
	ReadOnlySpan<int> source,
	ReadOnlySpan<int> destination
)

Parameters

source  ReadOnlySpan<Int32>
A read-only span containing the axes to move.
destination  ReadOnlySpan<Int32>
A read-only span containing the desired new positions of the axes.

Return Value

Tensor<T>
A view of the tensor with axes in source moved to the corresponding positions in destination.

Remarks

Negative values indicate the axis should be counted from the end.

The source and destination axes must each be unique.

Exceptions

DimensionMismatchException

source and destination do not have the same length.

ArgumentException

The axes specified by source are not all unique.

-or-

The axes specified by destination are not all unique.

See Also