tensorflow系列教程(1)之---fetch和feed的用法
来源:互联网 发布:数控编程案例 编辑:程序博客网 时间:2024/05/30 12:31
#fetch
import tensorflow as tf
x=tf.Variable([1,2])a=tf.constant([3,3])
sub=tf.subtract(x,a)
#全局变量初始化
init=tf.global_variables_initializer()
add=tf.add(x,sub)
with tf.Session() as sess:
sess.run(init)
print(sess.run(sub))
print(sess.run(add))
#feed,
#创建占位符
input1=tf.placeholder(tf.float32)
input2=tf.placeholder(tf.float32)
output=tf.multiply(input1,input2)
#feed数据以字典的形式传入
with tf.Session() as sess:
print(sess.run(output,feed_dict={input1:[7.0],input2:[2.0]}))
阅读全文
0 0
- tensorflow系列教程(1)之---fetch和feed的用法
- tensorflow之feed用法
- Tensorflow编程学习笔记(1)_Session、Variable、Fetch和Feed
- Tensorflow中的fetch与feed
- tensorflow系列教程(2)之---回归的例子
- TensorFlow学习-- 变量Variables/ Fetch/ Feed
- Tensorflow关于feed的问题
- git命令之git fetch的用法
- git命令之git fetch的用法
- git命令之git fetch的用法
- git命令之git fetch的用法
- git命令之git fetch的用法
- git命令之git fetch的用法
- Tensorflow系列之(一):Tensorflow的基本操作
- T-SQL用法(游标和Fetch)
- 【git系列之C】git pull和git fetch的区别
- 深入浅出的TensorFlow可视化工具TensorBoard用法教程(一)
- 深入浅出的TensorFlow可视化工具TensorBoard用法教程(二)
- 共享内存 shmget()、shmat()、shmdt()、shmctl()
- LintCode 最大平均值子数组
- java解决100盏灯,初始时都是关闭的。现在开始轮回100次,每次轮回是如是该次的倍数按一下开关。问第100次之后那几盏灯亮着?
- 数据类型转换
- 使用Sidecar将Node.js引入Spring Cloud
- tensorflow系列教程(1)之---fetch和feed的用法
- 重拾Java EE(1)——HTML
- class文件与dex文件比较
- Servlet过滤器和监听器
- The Largest Generation (25)
- 进程与线程之*定义*及*区别*
- Java学习从入门到精通的简单介绍
- Linux入门学习——进程
- SwipeRefreshLayout 无法刷新