To print a single tensor value in TensorFlow, you can use the tf.print()
function. For example, if you want to print the value of a tensor x
, you can use the following code:
import tensorflow as tf
x = tf.constant(10)
print("Value of x:", tf.print(x))
This will output:
Value of x: 10
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-04-25 11:00:00 +0000
Seen: 11 times
Last updated: Dec 22 '21