spdl.pipeline.defs.AggregateConfig

class AggregateConfig(name: str, op: Aggregator, drop_last: bool = False, _type: _PipeType = _PipeType.Aggregate)[source]

Configuration for aggregation operation.

Changed in version 0.2.1: The config has been generalized to support custom aggregation method. You can provide a custom implementation by subclassing Aggregator class and passing it via op.

With this change, num_items has been moved to Collate.

  • Before AggregateConfig(..., num_items=N, ...)

  • After AggregateConfig(..., op=Collate(N), ...)

Note

You can use Aggregate() to instantiate this config.

Attributes

drop_last

Whether to drop the last aggregation.

name

Name of the aggregation stage.

op

Aggregation operation.

drop_last: bool = False

Whether to drop the last aggregation.

name: str

Name of the aggregation stage.

op: Aggregator

Aggregation operation. It must be a subclass of Aggregator