get_aggregator#

scio.scores.utils.get_aggregator(aggr_or_ord)[source]#

Get a \(1\)D aggregator function.

Parameters:

aggr_or_ord (AggrNameLike | float) – Provide a float to get a vector norm aggregator, Else, see AggrName.

Returns:

out (Callable[..., Tensor]) – Aggregation function that accepts an optional dim: int argument. Depending on the aggregation method, may require input tensor to be of floating type and/or nonempty and/or nonnegative. May also accept dim: tuple[int, ...] | None, keepdim: bool and eventually dtype.