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_data.get_node_name(element_name), output_slot=debug_data.get_output_slot(element_name), debug_urls=["file://" + dump_path]) return dump_path, run_options
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_data.get_node_name(element_name), output_slot=debug_data.get_output_slot(element_name), debug_urls=["file://" + dump_path]) return dump_path, run_options
def testParseNodeNameInputWorks(self): self.assertEqual("a", debug_data.get_node_name("a")) self.assertEqual(0, debug_data.get_output_slot("a"))
def testParseTensorNameInputWorks(self): self.assertEqual("a", debug_data.get_node_name("a:0")) self.assertEqual(0, debug_data.get_output_slot("a:0")) self.assertEqual("_b", debug_data.get_node_name("_b:1")) self.assertEqual(1, debug_data.get_output_slot("_b:1"))
def testParseNodeNameInputWorks(self): self.assertEqual("a", debug_data.get_node_name("a")) self.assertEqual(0, debug_data.get_output_slot("a"))
def testParseTensorNameInputWorks(self): self.assertEqual("a", debug_data.get_node_name("a:0")) self.assertEqual(0, debug_data.get_output_slot("a:0")) self.assertEqual("_b", debug_data.get_node_name("_b:1")) self.assertEqual(1, debug_data.get_output_slot("_b:1"))