1/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/core/common_runtime/stats_publisher_interface.h"
17
18#include "tensorflow/core/framework/graph.pb.h"
19
20namespace tensorflow {
21namespace {
22
23// NoOpStatsPublisher provides an dummy/no-op implementation of
24// StatsPublisherInterface.
25class NoOpStatsPublisher : public StatsPublisherInterface {
26 public:
27 NoOpStatsPublisher() = default;
28
29 void PublishStatsProto(const StepStats& step_stats) override {}
30
31 void PublishGraphProto(
32 const std::vector<const GraphDef*>& graph_defs) override {}
33
34 std::unique_ptr<ProfileHandler> GetProfileHandler(
35 uint64 step, int64_t execution_count, const RunOptions& ropts) override {
36 return nullptr;
37 }
38
39 ~NoOpStatsPublisher() override = default;
40};
41
42} // namespace
43
44std::unique_ptr<StatsPublisherInterface> CreateNoOpStatsPublisher(
45 const string& session, const BuildGraphOptions& bopts,
46 const SessionOptions& sopts) {
47 return std::unique_ptr<StatsPublisherInterface>(new NoOpStatsPublisher);
48}
49
50} // namespace tensorflow
51