• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #ifndef TENSORFLOW_CORE_DEBUG_DEBUGGER_STATE_IMPL_H_
17 #define TENSORFLOW_CORE_DEBUG_DEBUGGER_STATE_IMPL_H_
18 
19 #include "tensorflow/core/common_runtime/debugger_state_interface.h"
20 
21 #include <unordered_set>
22 #include <vector>
23 
24 namespace tensorflow {
25 
26 class DebuggerState : public DebuggerStateInterface {
27  public:
28   DebuggerState(const DebugOptions& debug_options);
29   virtual ~DebuggerState();
30 
31   // Publish metadata about the debugged Session::Run() call.
32   //
33   // See the doc string of DebuggerStateInterface::PublishDebugMetadata() for
34   // details.
35   Status PublishDebugMetadata(const int64 global_step,
36                               const int64 session_run_count,
37                               const int64 executor_step_count,
38                               const std::vector<string>& input_names,
39                               const std::vector<string>& output_names,
40                               const std::vector<string>& target_names) override;
41 
42  private:
43   std::unordered_set<string> debug_urls_;
44 };
45 
46 class DebugGraphDecorator : public DebugGraphDecoratorInterface {
47  public:
DebugGraphDecorator(const DebugOptions & debug_options)48   DebugGraphDecorator(const DebugOptions& debug_options)
49       : debug_options_(debug_options) {}
~DebugGraphDecorator()50   virtual ~DebugGraphDecorator() {}
51 
52   Status DecorateGraph(Graph* graph, Device* device) override;
53   Status PublishGraph(const Graph& graph, const string& device_name) override;
54 
55  private:
56   DebugOptions debug_options_;
57 };
58 
59 }  // namespace tensorflow
60 
61 #endif  // TENSORFLOW_CORE_DEBUG_DEBUGGER_STATE_IMPL_H_
62