tf.Print 函数中的输入和数据参数是什么? [英] What is input and data parameters in tf.Print function?

查看:78
本文介绍了tf.Print 函数中的输入和数据参数是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tf.Print 函数.他们的意思是什么?我从文档中不明白这一点.

There are input and data parameters in tf.Print function. What do they mean? I don't understand this from documentaion.

假设我想打印张量 A.我应该将它作为 inputdata、两者或其他方式传递?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆