Method atLeastND
static member atLeastND: int -> Tensor<'T> -> Tensor<'T>
Pads the tensor from the left with size-one dimensions until it has at least the specified number of dimensions.
Declaration
static member atLeastND: minDims:int -> a:Tensor<'T> -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
int | minDims | The minimum number of dimensions. |
Tensor<'T> | a | The tensor to operate on. |
Returns
Type | Description |
---|---|
Tensor<'T> | A tensor with at least |
Remarks
Size-one dimensions are inserted at the front until the tensor has at least the specified number of dimensions. If it already has the specified number of dimensions or more, it is returned unchanged.
A view of the original tensor is returned and the storage is shared. Modifications done to the returned tensor will affect the original tensor.
Examples
let a = HostTensor.zeros [2L; 3L]
let b = Tensor.atLeastND 5 a // b.Shape = [1L; 1L; 1L; 2L; 3L]