예제 #1
0
  def testParseDebugNodeName_valid(self):
    debug_node_name_1 = "__dbg_ns_a/ns_b/node_c:1_0_DebugIdentity"
    (watched_node, watched_output_slot, debug_op_index,
     debug_op) = debug_data.parse_debug_node_name(debug_node_name_1)

    self.assertEqual("ns_a/ns_b/node_c", watched_node)
    self.assertEqual(1, watched_output_slot)
    self.assertEqual(0, debug_op_index)
    self.assertEqual("DebugIdentity", debug_op)
예제 #2
0
    def testParseDebugNodeName_valid(self):
        debug_node_name_1 = "__dbg_ns_a/ns_b/node_c:1_0_DebugIdentity"
        (watched_node, watched_output_slot, debug_op_index,
         debug_op) = debug_data.parse_debug_node_name(debug_node_name_1)

        self.assertEqual("ns_a/ns_b/node_c", watched_node)
        self.assertEqual(1, watched_output_slot)
        self.assertEqual(0, debug_op_index)
        self.assertEqual("DebugIdentity", debug_op)
예제 #3
0
  def testParseDebugNodeName_invalidWatchedTensorName(self):
    invalid_debug_node_name_1 = "__dbg_node1_0_DebugIdentity"

    with self.assertRaisesRegexp(ValueError,
                                 "Invalid tensor name in debug node name"):
      debug_data.parse_debug_node_name(invalid_debug_node_name_1)
예제 #4
0
  def testParseDebugNodeName_missingDebugOpIndex(self):
    invalid_debug_node_name_1 = "__dbg_node1:0_DebugIdentity"

    with self.assertRaisesRegexp(ValueError, "Invalid debug node name"):
      debug_data.parse_debug_node_name(invalid_debug_node_name_1)
예제 #5
0
  def testParseDebugNodeName_invalidPrefix(self):
    invalid_debug_node_name_1 = "__copy_ns_a/ns_b/node_c:1_0_DebugIdentity"

    with self.assertRaisesRegexp(ValueError, "Invalid prefix"):
      debug_data.parse_debug_node_name(invalid_debug_node_name_1)
예제 #6
0
    def testParseDebugNodeName_invalidWatchedTensorName(self):
        invalid_debug_node_name_1 = "__dbg_node1_0_DebugIdentity"

        with self.assertRaisesRegexp(ValueError,
                                     "Invalid tensor name in debug node name"):
            debug_data.parse_debug_node_name(invalid_debug_node_name_1)
예제 #7
0
    def testParseDebugNodeName_missingDebugOpIndex(self):
        invalid_debug_node_name_1 = "__dbg_node1:0_DebugIdentity"

        with self.assertRaisesRegexp(ValueError, "Invalid debug node name"):
            debug_data.parse_debug_node_name(invalid_debug_node_name_1)
예제 #8
0
    def testParseDebugNodeName_invalidPrefix(self):
        invalid_debug_node_name_1 = "__copy_ns_a/ns_b/node_c:1_0_DebugIdentity"

        with self.assertRaisesRegexp(ValueError, "Invalid prefix"):
            debug_data.parse_debug_node_name(invalid_debug_node_name_1)