Announcing the TensorFlow Dev Summit 2020 Learn more

View source on GitHub

Class StatsAggregator

A stateful resource that aggregates statistics from one or more iterators.


  • Class

To record statistics, use one of the custom transformation functions defined in this module when defining your All statistics will be aggregated by the StatsAggregator that is associated with a particular iterator (see below). For example, to record the latency of producing each element by iterating over a dataset:

dataset = ...
dataset = dataset.apply("total_bytes"))

To associate a StatsAggregator with a object, use the following pattern:

aggregator =
dataset = ...

# Apply `StatsOptions` to associate `dataset` with `aggregator`.
options =
options.experimental_stats.aggregator = aggregator
dataset = dataset.with_options(options)


View source


Initialize self. See help(type(self)) for accurate signature.