TensorFlow 2 version View source on GitHub

Prints message and the tensor value when evaluated.

Note that print_tensor returns a new tensor identical to x which should be used in the following code. Otherwise the print operation is not taken into account during evaluation.


x = K.print_tensor(x, message="x is: ")

x Tensor to print.
message Message to print jointly with the tensor.

The same tensor x, unchanged.