У меня есть следующая тестовая программа на Python:
import tensorflow as tf
sess = tf.InteractiveSession()
# Some tensor we want to print the value of
a = tf.one_hot(1,5)
# Add print operation
a = tf.Print(a, [a], message = "This is a: ")
# Add more elements of the graph using a
b = tf.add(a, a)
b.eval()
Я вызываю функцию, которая должна создать хорошее горячее кодирование.Я ожидаю, что на выходе будет:
array([0., 1., 0., 0., 0.], dtype=float32)
Но вместо этого на выходе будет:
array([0., 2., 0., 0., 0.], dtype=float32)
Почему?