Tensor.ReverseDimension Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ReverseDimension<T>(ReadOnlyTensorSpan<T>, Int32) |
Reverse the order of elements in the |
ReverseDimension<T>(ReadOnlyTensorSpan<T>, TensorSpan<T>, Int32) |
Reverse the order of elements in the |
ReverseDimension<T>(ReadOnlyTensorSpan<T>, Int32)
- Source:
- TensorExtensions.cs
Reverse the order of elements in the tensor
along the given dimension. The shape of the tensor is preserved, but the elements are reordered.
dimension
defaults to -1 when not provided, which reverses the entire tensor.
public:
generic <typename T>
static System::Numerics::Tensors::Tensor<T> ^ ReverseDimension(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % tensor, int dimension);
public static System.Numerics.Tensors.Tensor<T> ReverseDimension<T> (in System.Numerics.Tensors.ReadOnlyTensorSpan<T> tensor, int dimension);
static member ReverseDimension : ReadOnlyTensorSpan * int -> System.Numerics.Tensors.Tensor<'T>
Public Function ReverseDimension(Of T) (ByRef tensor As ReadOnlyTensorSpan(Of T), dimension As Integer) As Tensor(Of T)
Type Parameters
- T
Parameters
- tensor
- ReadOnlyTensorSpan<T>
Input Tensor<T>.
- dimension
- Int32
dimension along which to reverse over. -1 will reverse over all of the dimensions of the left tensor.
Returns
Applies to
ReverseDimension<T>(ReadOnlyTensorSpan<T>, TensorSpan<T>, Int32)
- Source:
- TensorExtensions.cs
Reverse the order of elements in the tensor
along the given axis. The shape of the tensor is preserved, but the elements are reordered.
dimension
defaults to -1 when not provided, which reverses the entire span.
public:
generic <typename T>
static System::Numerics::Tensors::TensorSpan<T> ^ ReverseDimension(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % tensor, System::Numerics::Tensors::TensorSpan<T> % destination, int dimension);
public static ref readonly System.Numerics.Tensors.TensorSpan<T> ReverseDimension<T> (scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> tensor, in System.Numerics.Tensors.TensorSpan<T> destination, int dimension);
static member ReverseDimension : ReadOnlyTensorSpan * TensorSpan * int -> TensorSpan
Public Function ReverseDimension(Of T) (ByRef tensor As ReadOnlyTensorSpan(Of T), ByRef destination As TensorSpan(Of T), dimension As Integer) As TensorSpan(Of T)
Type Parameters
- T
Parameters
- tensor
- ReadOnlyTensorSpan<T>
Input TensorSpan<T>.
- destination
- TensorSpan<T>
- dimension
- Int32
dimension along which to reverse over. -1 will reverse over all of the dimensions of the left tensor.