A stateful resource that aggregates statistics from one or more iterators.
tf.data.experimental.StatsAggregator()
To record statistics, use one of the custom transformation functions defined
in this module when defining your tf.data.Dataset. 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:
To associate a StatsAggregator with a tf.data.Dataset object, use
the following pattern:
aggregator=tf.data.experimental.StatsAggregator()dataset=...# Apply `StatsOptions` to associate `dataset` with `aggregator`.options=tf.data.Options()options.experimental_stats.aggregator=aggregatordataset=dataset.with_options(options)
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.data.experimental.StatsAggregator\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/data/experimental/StatsAggregator) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/data/experimental/ops/stats_aggregator.py#L31-L78) |\n\nA stateful resource that aggregates statistics from one or more iterators. \n\n tf.data.experimental.StatsAggregator()\n\nTo record statistics, use one of the custom transformation functions defined\nin this module when defining your [`tf.data.Dataset`](../../../tf/data/Dataset). All statistics will be\naggregated by the `StatsAggregator` that is associated with a particular\niterator (see below). For example, to record the latency of producing each\nelement by iterating over a dataset: \n\n dataset = ...\n dataset = dataset.apply(tf.data.experimental.latency_stats(\"total_bytes\"))\n\nTo associate a `StatsAggregator` with a [`tf.data.Dataset`](../../../tf/data/Dataset) object, use\nthe following pattern: \n\n aggregator = tf.data.experimental.StatsAggregator()\n dataset = ...\n\n # Apply `StatsOptions` to associate `dataset` with `aggregator`.\n options = tf.data.Options()\n options.experimental_stats.aggregator = aggregator\n dataset = dataset.with_options(options)\n\n| **Note:** This interface is experimental and expected to change. In particular, we expect to add other implementations of `StatsAggregator` that provide different ways of exporting statistics, and add more types of statistics."]]