116、TensorFlow变量的版本
import tensorflow as tf
v = tf.get_variable("v", shape=(), initializer=tf.zeros_initializer())
assignment = v.assign_add(1)
# Because variables are mutable
# it's sometimes useful to know what version of a variable's value is being used
# at any point in time.
# To force a re-read of the value of a variable after something has happened
# you can use tf.Variable.read_value. with tf.control_dependencies([assignment]):
w = v.read_value() # w is guaranteed to reflect v's value after the assign_add operation
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
print(sess.run(w))
下面是上面输出的结果
2018-02-17 10:57:11.629704: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
1.0
116、TensorFlow变量的版本的更多相关文章
- Windows下搭建TensorFlow的GPU版本
1.下载python3.5.2版本并安装(必须是3.5版本,而且3.5后不带字母的版本) 2.使用下面的地址下载tensorflow的GPU版本 http://www.lfd.uci.edu/~goh ...
- Word2Vec在Tensorflow上的版本以及与Gensim之间的运行对比
接昨天的博客,这篇随笔将会对本人运行Word2Vec算法时在Gensim以及Tensorflow的不同版本下的运行结果对比.在运行中,参数的调节以及迭代的决定本人并没有很好的经验,所以希望在展出运行的 ...
- tensorflow变量-【老鱼学tensorflow】
在程序中定义变量很简单,只要定义一个变量名就可以,但是tensorflow有点类似在另外一个世界,因此需要通过当前的世界中跟tensorlfow的世界中进行通讯,来告诉tensorflow的世界中定义 ...
- tensorflow变量
tensorflow变量: 1.神经网络中的参数权重,偏置等可以作为张量保存到tensorflow的变量中 2.tensorflow变量必须被初始化 3.可被保存到文件中,下次使用重新加载即可 ten ...
- windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras
转自:windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras 1.本来电脑安装的是anaconda3 5.3.1,但安装的python版本 ...
- tensorflow 安装GPU版本,个人总结,步骤比较详细【转】
本文转载自:https://blog.csdn.net/gangeqian2/article/details/79358543 手把手教你windows安装tensorflow的教程参考另一篇博文ht ...
- tensorflow变量的使用(02-2)
import tensorflow as tf x=tf.Variable([1,2]) a=tf.constant([3,3]) sub=tf.subtract(x,a) #增加一个减法op add ...
- windows10安装tensorflow的gpu版本(pip3安装方式)
前言: TensorFlow 有cpu和 gpu两个版本:gpu版本需要英伟达CUDA 和 cuDNN 的支持,cpu版本不需要:本文主要安装gpu版本. 1.环境 gpu:确认你的显卡支持 CUDA ...
- 如何在CentOS上安装Tensorflow的gpu版本?
系统配置 系统版本: Centos7.6 语言: Python3.5(anaconda3 4.2) 框架: Tensorflow 安装依赖 sudo yum install openjdk-8-jdk ...
随机推荐
- Hibernate异常:IllegalArgumentException
异常信息: java.lang.IllegalArgumentException: attempt to create delete event with null entity at org.hib ...
- 基于dvwa环境下级别为low的SQL手工注入教程
基于dvwa环境下级别为low的SQL手工注入教程: 首先是进入已搭建好的dvwa环境中去(一定要搭建好dvwa环境才能进行下面的操作),这可能会是一些初学者所面临的的第一个问题,比如我,曾为了寻找这 ...
- CentOS安装ruby, Haskall,io语言
安装ruby yum install ruby irb rdoc 安装Haskall yum install ghc 安装io语言 安装io语言,需要先安装cmake不过不要使用yum来进行安装,yu ...
- c#catch循环内捕获到异常继续循环
一,如果我们将异常而不影响循环,如下代码: using System; using System.Collections.Generic; using System.Linq; using Syste ...
- PHP中redis加锁和解锁的简单实现
背景说明 在程序开发过程中,通常会遇到需要独占式的访问一些资源的情形,比如商品秒杀时扣减库存.这时就需要对资源加锁.实现锁的方式有很多,比如数据库锁.文件锁等等.本文简单介绍PHP中使用redis来实 ...
- 2018-2-13-WPF-延迟加载
title author date CreateTime categories WPF 延迟加载 lindexi 2018-2-13 17:23:3 +0800 2018-2-13 17:23:3 + ...
- 2018-2-13-C#-搜索算法
title author date CreateTime categories C# 搜索算法 lindexi 2018-2-13 17:23:3 +0800 2018-2-13 17:23:3 +0 ...
- wxstring与其他类型转换
wxstring与其他类型转换 1.1 int to wxString: wxString str = wxString::Format(wxT("%i"),myInt); 1.2 ...
- (转)yum的$releasever真是太反动了
Posted on 2009年 10月9日 by JulyClyde 来看这篇文章的人,大都应该同意<Unix编程艺术>中提到的那些观点吧.今天就给大家看一个反例:yum 的 $relea ...
- Git--01 基础 - 远程仓库的使用
目录 Git 基础 - 远程仓库的使用 远程仓库的使用 查看远程仓库 添加远程仓库 从远程仓库中抓取与拉取 推送到远程仓库 查看某个远程仓库 远程仓库的移除与重命名 Git 基础 - 远程仓库的使用 ...