Tensor.AtLeast2D Method

Definition

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

Overload List

AtLeast2D<T>(Tensor<T>) Returns an equivalent tensor that has at least two dimensions.
AtLeast2D<T>(Tensor<T>[]) Returns an array of equivalent tensors that have at least two dimensions.

AtLeast2D<T>(Tensor<T>)

Returns an equivalent tensor that has at least two dimensions.
C#
public static Tensor<T> AtLeast2D<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>
tensor if its tensor rank is at least 2; otherwise a rank-2 tensor with 1 row.

AtLeast2D<T>(Tensor<T>[])

Returns an array of equivalent tensors that have at least two dimensions.
C#
public static Tensor<T>[] AtLeast2D<T>(
	params Tensor<T>[] tensors
)

Parameters

tensors  Tensor<T>[]
An array of tensors.

Type Parameters

T
The type of the elements of the tensors.

Return Value

Tensor<T>[]
An array of tensors. If the tensor rank of an element of tensors is at least 2, then the tensor is returned unmodified; otherwise it is replaced with a rank-2 tensor with 1 row.

See Also