20171130_tensorflow_session
来源:互联网 发布:渔具招商 源码 编辑:程序博客网 时间:2024/06/15 02:29
此篇代码主要介绍Session的类似与python的with 用法,比较习惯with用法
#!/usr/bin/env python# -*- coding: utf-8 -*-# @Date : 2017-11-30 19:27:06# @Author : Lebhoryi@gmail.com# @Link : https://morvanzhou.github.io/tutorials/machine-learning/tensorflow/2-3-session/# @Version : Session 会话控制import tensorflow as tfmatrix1 = tf.constant([[3,3]])matrix2 = tf.constant([[2], [2]])product = tf.matmul(matrix1,matrix2) # matrix multiply,np.dot(m1,m2)# method 1sess = tf.Session()result = sess.run(product)print(result)sess.close()# method2 推荐用后面一种with tf.Session() as sess: result2 = sess.run(product) print(result2)
阅读全文
0 0
- 20171130_tensorflow_session
- 20171130 自省
- 20171130memo
- 20171130_tensorflow_tf.Variable
- 20171130android的adb调试
- 公众号“今日作文素材”文章列表 (20171101-20171130)
- 20171130学习笔记,有关Hibernate的数据默认值
- 20171130学习笔记之DDL、DML和DCL之见的区别
- Kibana Essentials.pdf 英文原版 免费下载
- java集合List、Set特点与hashSet存储实现原理
- matlab对文件,目录的操作
- Java并发学习(十一)-LongAdder和LongAccumulator探究
- PAT刷题:1035. Password (20)
- 20171130_tensorflow_session
- adminLTE 教程 -2 配置文件 app.js详解
- Linux下sudo命令实例讲解
- 简单的背包问题
- Lua中元方法__tostring的使用
- Microservices, IoT and Azure.pdf 英文原版 免费下载
- arcgis10.1发布几种切片详细说明
- 浏览器与cdn缓存
- Spring Cloud (6) | spring cloud zuul 跨域问题No 'Access-Control-Allow-Origin' header