tensorflow基础使用2
来源:互联网 发布:a 算法解决八数码难题 编辑:程序博客网 时间:2024/06/15 05:41
Fetch和Feed的用法
1.fetch的用法也就是在session运行时,可以以列表的方式传参,从而同时run多个op
# -*- coding:utf-8 -*-import tensorflow as tf# how to use Fetchinput1 = tf.constant(3.0)input2 = tf.constant(2.0)input3 = tf.constant(5.0)add = tf.add(input2,input3)mul = tf.multiply(input1,add)with tf.Session() as sess: result = sess.run([mul,add]) ##Fetch print(result)2.Feed的用法
即在调用session的run方法时,传入一个函数,再以字典的形式传入其参数
# -*- coding:utf-8 -*-import tensorflow as tf# how to use Feedinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1,input2)with tf.Session() as sess: # use Feed with Dict print(sess.run(output,feed_dict={input1:[7.],input2:[2.]}))
阅读全文
0 0
- tensorflow基础使用2
- tensorflow基础使用1
- tensorflow基础使用3
- tensorflow基础使用4
- tensorflow基础使用5
- TensorFlow使用基础(Basic Usage)
- TensorFlow教程 2 TensorFlow基础构架
- tensorflow:2)卷积神经网络基础
- Tensorflow-2-Tensorboard使用
- TensorFlow基础
- Tensorflow基础
- Tensorflow基础
- Tensorflow 基础
- Tensorflow基础
- tensorflow基础
- Tensorflow基础
- TensorFlow基础
- tensorflow基础
- python encode和decode函数说明
- char、varchar、nvarchar的区别
- 数据库查看所有外键,验证某外键是否已经存在(mysql)
- 网狐pc端大厅登录提示尝试了所有的服务器都无法成功连接
- oracle学习小记1——日期的加减及截取字符串
- tensorflow基础使用2
- zlib库VS2015编译步骤
- java8,你应该了解的新特性(空指针终结者:Optional 类)
- iOS 宏定义~SystemVersionAndModel(系统版本和机型)
- Caffe学习(8)——训练和测试自己的图片
- Cmd执行带包名的Java文件
- linux
- PAT乙级 1035. 插入与归并(25)
- 浅谈CountDownLatch的用法