Tensor.RemoveSingletonAxes<T> Method

Removes all singleton dimensions from a tensor.

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0
C#
public static Tensor<T> RemoveSingletonAxes<T>(
	Tensor<T> tensor
)

Parameters

tensor  Tensor<T>
A tensor.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
If tensor has any singleton dimensions (of length 1), then a tensor of lower rank with these dimensions removed; otherwise, tensor.

Exceptions

ArgumentNullException

tensor is null.

See Also