2017-10-09 67 views

回答

2

tf.Print行为像tf.identity,因此它的作用就像input=tf.identity(input),即参数input, 和data: A list of tensors to print out when op is evaluated,这意味着当我们运行input,所述data将被评估,其结果将被打印的含义。

如果要运行运算A和打印运B,C,你应该使用A=tf.Print(A, [B,C])然后运行sess.run(A)

+0

想我wan't只打印'A',没有任何'B'或'C'。 – Dims

+0

您只需使用'A'而不是'B,C',这意味着'A = tf.Print(A,[A])' – gaussclb

+0

好的,所以左边部分'A ='是必不可少的,谢谢。 – Dims

相关问题