tfdbg.DebugTensorDatum

Class DebugTensorDatum

Defined in tensorflow/python/debug/lib/debug_data.py.

See the guide: TensorFlow Debugger > Classes for debug-dump data and directories

A single tensor dumped by TensorFlow Debugger (tfdbg).

Contains metadata about the dumped tensor, including timestamp, node_name, output_slot, debug_op, and path to the dump file (file_path).

This type does not hold the generally space-expensive tensor value (numpy array). Instead, it points to the file from which the tensor value can be loaded (with the get_tensor method) if needed.

Properties

debug_op

Name of the debug op.

Returns:

(str) debug op name (e.g., DebugIdentity).

device_name

Name of the device that the tensor belongs to.

Returns:

(str) device name.

dump_size_bytes

Size of the dump file.

Unit: byte.

Returns:

If the dump file exists, size of the dump file, in bytes. If the dump file does not exist, None.

extended_timestamp

Extended timestamp, possibly with an index suffix.

The index suffix, e.g., "-1", is for disambiguating multiple dumps of the same tensor with the same timestamp, which can occur if the dumping events are spaced by shorter than the temporal resolution of the timestamps.

Returns:

(str) The extended timestamp.

file_path

Path to the file which stores the value of the dumped tensor.

node_name

Name of the node from which the tensor value was dumped.

Returns:

(str) name of the node watched by the debug op.

output_slot

Output slot index from which the tensor value was dumped.

Returns:

(int) output slot index watched by the debug op.

tensor_name

Name of the tensor watched by the debug op.

Returns:

(str) Tensor name, in the form of node_name:output_slot

timestamp

Timestamp of when this tensor value was dumped.

Returns:

(int) The timestamp in microseconds.

watch_key

Watch key identities a debug watch on a tensor.

Returns:

(str) A watch key, in the form of tensor_name:debug_op.

Methods

__init__

__init__(
    dump_root,
    debug_dump_rel_path
)

DebugTensorDatum constructor.

Args:

  • dump_root: (str) Debug dump root directory. This path should not include the path component that represents the device name (see also below).
  • debug_dump_rel_path: (str) Path to a debug dump file, relative to the dump_root. The first item of this relative path is assumed to be a path representing the name of the device that the Tensor belongs to. See device_path_to_device_name for more details on the device path. For example, suppose the debug dump root directory is /tmp/tfdbg_1 and the dump file is at /tmp/tfdbg_1/<device_path>/>ns_1/node_a_0_DebugIdentity_123456789, then the value of the debug_dump_rel_path should be <device_path>/ns_1/node_a_0_DebugIdenity_1234456789.

Raises:

  • ValueError: If the base file name of the dump file does not conform to the dump file naming pattern: node_nameoutput_slotdebug_op_timestamp

get_tensor

get_tensor()

Get tensor from the dump (Event) file.

Returns:

The tensor loaded from the dump (Event) file.