|
| 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 | +"""CLI Backend for the Analyzer Part of the Debugger. |
| 16 | +
|
| 17 | +The analyzer performs post hoc analysis of dumped intermediate tensors and |
| 18 | +graph structure information from debugged Session.run() calls. |
| 19 | +""" |
| 20 | + |
| 21 | +def _make_source_table(self, source_list, is_tf_py_library): |
| 22 | + lines=[] |
| 23 | + return debugger_cli_common.rich_text_lines_from_rich_line_list(lines) |
| 24 | +class DebugAnalyzer(object): |
| 25 | + def print_source(self, args, screen_info=None): |
| 26 | + pass |
| 27 | + def list_source(self, args, screen_info=None): |
| 28 | + output = [] |
| 29 | + source_list = [] |
| 30 | + output.extend(self._make_source_table( |
| 31 | + [item for item in source_list if not item[1]], False)) |
| 32 | + output.extend(self._make_source_table( |
| 33 | + [item for item in source_list if item[1]], True)) |
| 34 | + _add_main_menu(output, node_name=None) |
| 35 | + return output |
0 commit comments