tf.assign的用法
来源:互联网 发布:电脑上的c语言编程软件 编辑:程序博客网 时间:2024/06/01 10:48
tf.assign(A, new_number): 这个函数的功能主要是把A的值变为new_number
例如:
输出:0.0
10.0
开始给A赋值为0,经过tf.assign函数后,把A的值变为10
print("sssssssssss 2 ")
state = tf.Variable(0,name="counter")
one = tf.constant(1)
new_value = tf.add(state, one)
update = tf.assign(state, new_value)
init_op = tf.initialize_all_variables()
with tf.Session() as sess:
# Runthe 'init' op
sess.run(init_op)
# Printthe initial value of 'state'
print(sess.run(state))
# Runthe op that updates 'state' and print 'state'.
for k in range(5):
sess.run(update)
print(sess.run(state))
阅读全文
0 0
- tf.assign的用法
- tf.assign的用法
- tf.assign()
- ASSIGN的用法
- string assign 的用法
- vertor的assign用法
- string的assign用法
- tf.concat的用法
- tf.reduce_mean的用法
- tf.clip_by_value的用法
- tf.convert_to_tensor的用法
- tf.select的用法
- tf.truncated_normal的用法
- tf.concat的用法
- tf.cond()的用法
- tf.concat的用法
- tf.truncated_normal的用法
- tf.truncated_normal的用法
- android7.0 wallpaper显示流程
- java-ApplicationContextAware接口
- 程序员的一些座右铭
- Mac版-android开发工具eclipse的安装以及支持各种sdk
- mysql nvarchar 和 varchar
- tf.assign的用法
- 自定义$插件注意事项
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sojs
- asp.net mvc 跳转到登录,浏览器带来源的url
- 【codevs 2169】【Tyvj 1032】【洛谷 2376】【洛谷2619】零用钱
- Java package使用方法
- YUV图像格式
- java操作hive2.1.0
- linux的常用命令