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_blockproduces partial sumss1ands2from two different blocks,combine(s1, s2)should returns1 + s2.- Parameters:
current_accumulator – The current accumulated state (e.g., the result of previous
combinecalls or an initial value fromzero_factory).new – A new partially aggregated value, typically the output of
aggregate_blockfrom a new block of data, or another accumulator from a parallel task.
- Returns:
The updated accumulator after combining it with the new value.