import tensorflow as tf

a = tf.constant(20)
b = tf.constant(10)

result1 = tf.cond(a > b, lambda: a, lambda: b)
result2 = tf.cond(a < b, lambda: a, lambda: b)

# Initialize all the variables (including parameters) randomly.
init_op = tf.initialize_all_variables()

sess = tf.InteractiveSession()
# Run the init_op, evaluate the model outputs and print the results:
sess.run(init_op)

print sess.run(a)
print sess.run(b)
print "max value is: %d" % sess.run(result1)
print "min value is: %d" % sess.run(result2)
20
10
max value is: 20
min value is: 10

最新文章

  1. jfinal和httl结合
  2. 百度地图API使用方法详解
  3. pptv破解版程序,能够免费观看所有蓝光和会员影片!
  4. 学习练习 java编写西游记人物类
  5. DOM 1
  6. Ruby中的Symbol与字符串
  7. Solaris 11的自动化安装(AI server)的搭建
  8. Gym 101257G 24 (概率+二分)
  9. bzoj 4826: [Hnoi2017]影魔 [主席树 单调栈]
  10. 【iOS 开发】iOS 开发 简介 (IOS项目文件 | MVC 模式 | 事件响应机制 | Storyboard 控制界面 | 代码控制界面 | Retina 屏幕图片适配)
  11. 计算机视觉学习记录 - Implementing a Neural Network from Scratch - An Introduction
  12. ArcGIS为面要素生成邻接矩阵
  13. keras神经网络做简单的回归问题
  14. leetcode每日刷题计划-简单篇day13
  15. ansible详解
  16. Spring-JDBC依赖
  17. pthreads v3下的worker和pool的使用
  18. Daily Scrum NO.1
  19. [Java123]Gradle
  20. CSS HTML 常用属性备忘录

热门文章

  1. mysql zip 文件安装
  2. c++模板使用及实现模板声明定义的分离
  3. [LeetCode] Diameter of Binary Tree 二叉树的直径
  4. mybatis学习三
  5. [LOJ 6185]烷基计数
  6. Codefroces 850C Arpa and a game with Mojtaba
  7. hdu 2865 Polya计数+(矩阵 or 找规律 求C)
  8. Saltstack基础
  9. IP地址、子网掩码、网关、DNS服务器
  10. js去掉最后一个字符