Method foldAxis
val foldAxis: 'T -> 'TA -> 'T -> 'T -> int -> Tensor<'TA> -> Tensor<'T>
Applies to specified function to all elements of the tensor, threading an accumulator through the computation using multiple threads.
Declaration
val foldAxis: fn:'T -> 'TA -> 'T -> initial:'T -> axis:int -> a:Tensor<'TA> -> Tensor<'T>
Parameters
| Type | Name | Description |
|---|---|---|
| 'T -> 'TA -> 'T | fn | A function that takes a state value and a value from the input tensor and returns a new state value. |
| 'T | initial | The initial state value. |
| int | axis | The axis to fold over. |
| Tensor<'TA> | a | The source tensor. |
Returns
| Type | Description |
|---|---|
| Tensor<'T> | The output tensor containg the final states. |
Type Parameters
| Name | Description |
|---|---|
| 'T | The type of the data. |
| 'TA |