Another option to print values for debugging purposes is to use tf.Print(). You can wrap a tensor in tf.Print() to print its values in the standard error console when the path containing the tf.Print() node is executed. The tf.Print() function has the following signature:
tf.Print(
input_,
data,
message=None,
first_n=None,
summarize=None,
name=None
)
The arguments to this function are as follows:
- input_ is a tensor that gets returned from the function without anything being done to it
- data is the list of tensors that get printed
- message is a string that gets printed as a prefix to the printed output
- first_n represents the number of steps to print the output; if this value is negative then the value is always printed whenever the path is executed
- summarize represents the number of elements to print from the tensor...