Tensor.At Least 1D Method
Definition
Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3
Overload List
AtLeast1D<T>(Tensor<T>) | Returns an equivalent tensor that has at least one dimension. |
AtLeast1D<T>(Tensor<T>[]) | Returns an array of equivalent tensors that have at least one dimension. |
AtLeast1D<T>(Tensor<T>)
Returns an equivalent tensor that has at least one dimension.
public static Tensor<T> AtLeast1D<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 1; otherwise a rank-1 tensor with 1 element.
AtLeast1D<T>(Tensor<T>[])
Returns an array of equivalent tensors that have
at least one dimension.
public static Tensor<T>[] AtLeast1D<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 1, then the tensor is returned unmodified; otherwise it is replaced with a rank-1 tensor with 1 element.