accumulate#
- swordfish.function.accumulate()#
The accumulate template applies func to init and X for accumulating iteration (i.e. the result of an iteration is passed forward to the next). Unlike the template reduce that returns only the last result, the template accumulate outputs result of each iteration.
- Parameters:
func (Constant) – A function for iteration.
X (Constant) – Data or iteration rule.
init (Constant, optional) – The initial value to be passed to func, by default DFLT.
assembleRule (Union[Alias[Literal["consistent"]], Constant], optional) – Indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, by default DFLT.