tf.identity()的理解
2017-08-23 20:43
309 查看
import tensorflow as tf x = tf.Variable(1.0) x_plus_1 = tf.assign_add(x, 1) with tf.control_dependencies([x_plus_1]): y = x z=tf.identity(x,name='x') init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) for i in range(5): print(sess.run(z))
输出是:2,3,4,5,6
但是:
import tensorflow as tf x = tf.Variable(1.0) x_plus_1 = tf.assign_add(x, 1) with tf.control_dependencies([x_plus_1]): y = x z=tf.identity(x,name='x') init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) for i in range(5): print(sess.run(y))
的输出是:1,1,1,1,1
相关文章推荐
- tf.reduce_sum理解(小记)
- 转载!tf.clip_by_global_norm理解
- 深入理解Aspnet Core之Identity(3)
- TF-IDF理解及其Java实现
- TF库的使用与理解(转载)
- Tensorflow 中的tf.reshape()理解和操作
- tensorflow学习——tf.get_collection(), tf.identity()
- tf.identity的意义以及用例
- tf.identity 和 tf.control_dependencies的用法
- 图示理解卷积运算、逆卷积运算、Tensorflow、tf.nn.conv2d_transpose、Conv2DSlowBackpropInput: Size of out_backprop doesn
- tf-faster-rcnn代码理解
- tf.nn.conv2d理解
- tf.multinomial()函数的理解
- 深入理解Aspnet Core之Identity(3)
- 自然语言处理 - 如何通俗地理解TFIDF?
- TF-IDF理解及其Java实现
- 理解ASP.NET Core验证模型(Claim, ClaimsIdentity, ClaimsPrincipal)不得不读的英文博文
- tf_prefix的理解
- 深入理解Aspnet Core之Identity(1)