ray.data.aggregate.AggregateFnV2.combine#
- abstract AggregateFnV2.combine(current_accumulator: AggType, new: AggType) AggType [source]#
Combines a new partial aggregation result with the current accumulator.
This method defines how two intermediate aggregation states are merged. For example, if
aggregate_block
produces partial sumss1
ands2
from two different blocks,combine(s1, s2)
should returns1 + s2
.- Parameters:
current_accumulator – The current accumulated state (e.g., the result of previous
combine
calls or an initial value fromzero_factory
).new – A new partially aggregated value, typically the output of
aggregate_block
from a new block of data, or another accumulator from a parallel task.
- Returns:
The updated accumulator after combining it with the new value.