diff options
author | Shivani Agrawal <shivaniagrawal@google.com> | 2018-10-03 12:44:47 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-03 12:51:54 -0700 |
commit | 808b1dcb318b1feb5a8c9fed5558f95cd05728e4 (patch) | |
tree | a2286241b6a0c8cba24b1da629fa6e7db475d7dc /tensorflow/core/framework | |
parent | 19833284cc8fa555115aacde350ad66652b250dc (diff) |
[data-stats] Sets user given `tag` and `counter_prefix` with `set_stats_aggregator`. `tag` would get prep-end with all the statistics recorded as summary and `counter_prefix` would set the prefix for the statistics recorded as counter.
Note: `counter` defaults to `\tensorflow`, and `tag` and `prefix` gets associated with the dataset (not the stats_aggregator).
PiperOrigin-RevId: 215609159
Diffstat (limited to 'tensorflow/core/framework')
-rw-r--r-- | tensorflow/core/framework/dataset.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/tensorflow/core/framework/dataset.h b/tensorflow/core/framework/dataset.h index 8c1151cb56..964a7d5f8c 100644 --- a/tensorflow/core/framework/dataset.h +++ b/tensorflow/core/framework/dataset.h @@ -278,15 +278,8 @@ class IteratorContext { // Function call support. std::function<void(std::function<void()>)> runner = nullptr; - // A function that returns the current `StatsAggregator` instance to be - // used when recording statistics about the iterator. - // - // NOTE(mrry): This is somewhat awkward, because (i) the `StatsAggregator` - // is a property of the `IteratorResource` (which this class does not know - // about), and (ii) it can change after the `IteratorContext` has been - // created. Better suggestions are welcome! - std::function<std::shared_ptr<StatsAggregator>()> stats_aggregator_getter = - nullptr; + // The `StatsAggregator` object to record statistics about the iterator. + std::shared_ptr<StatsAggregator> stats_aggregator = nullptr; // The FunctionLibraryRuntime object to be used to make function calls. FunctionLibraryRuntime* lib = nullptr; @@ -320,13 +313,6 @@ class IteratorContext { return ¶ms_.runner; } - std::shared_ptr<StatsAggregator> stats_aggregator() { - if (params_.stats_aggregator_getter) { - return params_.stats_aggregator_getter(); - } else { - return nullptr; - } - } std::shared_ptr<const FunctionLibraryDefinition> function_library() { return params_.function_library; @@ -344,8 +330,8 @@ class IteratorContext { return params_.allocator_getter; } - std::function<std::shared_ptr<StatsAggregator>()> stats_aggregator_getter() { - return params_.stats_aggregator_getter; + std::shared_ptr<StatsAggregator> stats_aggregator() { + return params_.stats_aggregator; } std::shared_ptr<model::Model> model() { return params_.model; } |