def testDebugDatum(self): dump_root = "/tmp/tfdbg_1" debug_dump_rel_path = "ns1/ns2/node_a_1_2_DebugIdentity_1472563253536385" datum = debug_data.DebugTensorDatum(dump_root, debug_dump_rel_path) self.assertEqual("DebugIdentity", datum.debug_op) self.assertEqual("ns1/ns2/node_a_1", datum.node_name) self.assertEqual(2, datum.output_slot) self.assertEqual("ns1/ns2/node_a_1:2", datum.tensor_name) self.assertEqual(1472563253536385, datum.timestamp) self.assertEqual("ns1/ns2/node_a_1:2:DebugIdentity", datum.watch_key) self.assertEqual(os.path.join(dump_root, debug_dump_rel_path), datum.file_path) self.assertEqual( "{DebugTensorDatum: %s:%d @ %s @ %d}" % (datum.node_name, datum.output_slot, datum.debug_op, datum.timestamp), str(datum)) self.assertEqual( "{DebugTensorDatum: %s:%d @ %s @ %d}" % (datum.node_name, datum.output_slot, datum.debug_op, datum.timestamp), repr(datum))
def setUp(self): self._dummy_datum = dummy_datum = debug_data.DebugTensorDatum( "/foo", "bar_0_DebugIdentity_42")
def testDumpSizeBytesIsNoneForNonexistentFilePath(self): dump_root = "/tmp/tfdbg_1" debug_dump_rel_path = "ns1/ns2/node_foo_1_2_DebugIdentity_1472563253536385" datum = debug_data.DebugTensorDatum(dump_root, debug_dump_rel_path) self.assertIsNone(datum.dump_size_bytes)