Method flatten
static member flatten: Tensor<'T> -> Tensor<'T>
Flattens the tensor into a (one-dimensional) vector.
Declaration
static member flatten: a:Tensor<'T> -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
Tensor<'T> | a | The tensor to operate on. |
Returns
Type | Description |
---|---|
Tensor<'T> | A vector. |
Remarks
If a reshape is possible without copying the data of the tensor, a view of the original tensor is returned and the storage is shared. In this case, modifications done to the returned tensor will affect the original tensor.
Examples
let a = HostTensor.zeros [2L; 3L; 4L]
let b = Tensor.flatten a // b.Shape = [24L]