Method insertAxis
static member insertAxis: int -> Tensor<'T> -> Tensor<'T>
Insert a dimension of size one before the specifed dimension.
Declaration
static member insertAxis: ax:int -> a:Tensor<'T> -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
int | ax | The dimension to insert before. |
Tensor<'T> | a | The tensor to operate on. |
Returns
Type | Description |
---|---|
Tensor<'T> | The resulting tensor. |
Remarks
The operation returns a view of the original tensor and shares its storage. Modifications done to the returned tensor will affect the original tensor. Also, modifying the orignal tensor will affect the view.
Examples
let a = HostTensor.zeros [3L; 4L; 5L]
let b = Tensor.insertAxis 1 a // b.Shape = [3L; 1L 4L; 5L]