tf.control_dependencies()和tf.identity()
2017-11-16 19:58
435 查看
示例一:
程序运行的结果:
示例二:
运行结果:
仔细观察两个示例的区别,只是第6行代码的不同.
先来说明下第5行:tf.Graph.control_dependencies简单来说就是控制计算顺序。
with g.control_dependencies([a, b, c]):
# ‘d’ and ‘e’ will only run after ‘a’, ‘b’, and ‘c’ have executed.
d = …
e = …
注意一点的是:
第7,8和9行注释后,打印的结果是:
如果注释掉第10行,第7,8或者9行任意一行去掉注意,打印的结果都是数字5,令我迷惑不解的是第9行取消注意打印的结果为什么不是4而是5呢,还没想明白原因,待解惑
非常好的博客地址:
http://blog.csdn.net/Yan_Joy/article/details/70228401?locationNum=12&fps=1
http://blog.csdn.net/PKU_Jade/article/details/73498753
程序运行的结果:
示例二:
运行结果:
仔细观察两个示例的区别,只是第6行代码的不同.
先来说明下第5行:tf.Graph.control_dependencies简单来说就是控制计算顺序。
with g.control_dependencies([a, b, c]):
# ‘d’ and ‘e’ will only run after ‘a’, ‘b’, and ‘c’ have executed.
d = …
e = …
注意一点的是:
第7,8和9行注释后,打印的结果是:
如果注释掉第10行,第7,8或者9行任意一行去掉注意,打印的结果都是数字5,令我迷惑不解的是第9行取消注意打印的结果为什么不是4而是5呢,还没想明白原因,待解惑
非常好的博客地址:
http://blog.csdn.net/Yan_Joy/article/details/70228401?locationNum=12&fps=1
http://blog.csdn.net/PKU_Jade/article/details/73498753
相关文章推荐
- Tensorflow 解惑[一]:关于tf.identity 和tf.control_dependencies
- tf.identity 和 tf.control_dependencies的用法
- tf.control_dependencies与tf.identity组合详解
- tf.control_dependencies()作用及用法
- TensorFlow入门基础知识(七)tf.control_dependencies的用法
- tf.control_dependencies()
- tf.control_dependencies()
- tensorflow API:tf.control_dependencies
- tf.control_dependencies()作用及用法
- (Tensorflow之十)tf.control_dependencies()用法
- Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The parameter is incorrect. (Exception
- 升级TFS2012查看SOURCE-history部分提示TF14045: The identity xxx is not a recognized identity
- tf.identity的意义以及用例
- TensorFlow流程控制函数:tf.group tf.control_dependencies
- tensorflow学习——tf.get_collection(), tf.identity()
- tf.identity()的理解
- tf.identity的意义以及用例
- Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The parameter is incorrect.
- CruiseControl Enterprise 最佳实践 (2) : Keep your dependencies to yourself