Пример #1
0
    def _prepare_cont_call_dump_path_and_run_options(self):
        """Prepare the dump path and RunOptions for next cont() call.

    Returns:
      dump_path: (str) Directory path to which the intermediate tensor will be
        dumped.
      run_options: (config_pb2.RunOptions) The RunOptions containing the tensor
        watch options for this graph.
    """
        run_options = config_pb2.RunOptions()
        dump_path = self._cont_call_dump_path()
        for element_name in self._closure_elements:
            if ":" in element_name:
                debug_utils.add_debug_tensor_watch(
                    run_options,
                    debug_graphs.get_node_name(element_name),
                    output_slot=debug_graphs.get_output_slot(element_name),
                    debug_urls=["file://" + dump_path])

        return dump_path, run_options
Пример #2
0
  def _prepare_cont_call_dump_path_and_run_options(self):
    """Prepare the dump path and RunOptions for next cont() call.

    Returns:
      dump_path: (str) Directory path to which the intermediate tensor will be
        dumped.
      run_options: (config_pb2.RunOptions) The RunOptions containing the tensor
        watch options for this graph.
    """
    run_options = config_pb2.RunOptions()
    dump_path = self._cont_call_dump_path()
    for element_name in self._closure_elements:
      if ":" in element_name:
        debug_utils.add_debug_tensor_watch(
            run_options,
            debug_graphs.get_node_name(element_name),
            output_slot=debug_graphs.get_output_slot(element_name),
            debug_urls=["file://" + dump_path])

    return dump_path, run_options
Пример #3
0
 def testParseNodeNameInputWorks(self):
     self.assertEqual("a", debug_graphs.get_node_name("a"))
     self.assertEqual(0, debug_graphs.get_output_slot("a"))
Пример #4
0
    def testParseTensorNameInputWorks(self):
        self.assertEqual("a", debug_graphs.get_node_name("a:0"))
        self.assertEqual(0, debug_graphs.get_output_slot("a:0"))

        self.assertEqual("_b", debug_graphs.get_node_name("_b:1"))
        self.assertEqual(1, debug_graphs.get_output_slot("_b:1"))