tf.Print 函数中的输入和数据参数是什么? [英] What is input and data parameters in tf.Print function?
问题描述
tf.Print 函数.他们的意思是什么?我从文档中不明白这一点.
There are input
and data
parameters in tf.Print function. What do they mean? I don't understand this from documentaion.
假设我想打印张量 A
.我应该将它作为 input
、data
、两者或其他方式传递?
Suppose I wish to print tensor A
. Should I pass it as input
, data
, both or someother way?
推荐答案
tf.Print
的作用类似于 tf.identity
,所以它的作用类似于 input=tf.identity(input)
,即参数input
的含义,和 data:在计算 op 时打印出的张量列表
,这意味着当我们运行 input
时,data
将被计算并且结果将被打印出来.
The tf.Print
acts like tf.identity
, so it acts like input=tf.identity(input)
, that is meaning of parameters input
,
and data: A list of tensors to print out when op is evaluated
, which means when we run the input
, the data
will be evaluated and the results will be printed.
当你想运行 op A
并打印 op B,C
时,你应该使用 A=tf.Print(A, [B,C])
然后运行 sess.run(A)
When you want to run op A
and print the op B,C
, you should use A=tf.Print(A, [B,C])
and then run sess.run(A)
这篇关于tf.Print 函数中的输入和数据参数是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!