#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tensorflow as tf 

x = tf.constant(2)
y = tf.constant(20)
z = tf.Variable([[6,1,2],[3,4,5],[0,0,0],[8,2,4]])
mask=z[:,0]>0
res = tf.boolean_mask(z,mask)

init_assign = tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init_assign)

print sess.run(res)

运行结果:

[[6 1 2]
 [3 4 5]
 [8 2 4]]

最新文章

  1. synchronized和ReentrantLock
  2. iOS 原生态扫描二维码、条形码的功能。
  3. [UVA11464]Even Parity(状压,枚举)
  4. Best Practices for Web Apps
  5. 堆排序 C++
  6. (一)初识Android
  7. jQuery mouseover,mouseout事件多次执行的问题处理
  8. ADO.NET知识的运用一(Day 26)
  9. 替换NavigationController里面的返回按钮
  10. linux操作系统简单使用
  11. 《JavaScript高级程序设计》读书笔记 ---变量、作用域和内存问题小结
  12. 一个可以提高开发效率的Git命令-- Cherry-Pick
  13. TCP/IP和HTTP协议代理
  14. PAT1043:Is It a Binary Search Tree
  15. SpringBoot启动如何加载application.yml配置文件
  16. ThreadPoolExecutor系列三——ThreadPoolExecutor 源码解析
  17. python 包 笔记
  18. 电脑小白和ta的小白电脑——MySQL数据库
  19. CentOS 7 yum nginx MySQL PHP7 简易环境搭建(精)
  20. jmeter对需要登录的接口进行性能测测试

热门文章

  1. 20145321 《Java程序设计》第3周学习总结
  2. 20145109 实验四 Andoid开发基础
  3. [BZOJ4010]菜肴制作
  4. Codeforces - 828E DNA Evolution —— 很多棵树状数组
  5. Python学习札记(十二) Function3 函数参数一
  6. linux用户态与内核态
  7. bzoj 1270: [BeijingWc2008]雷涛的小猫 简单dp+滚动数组
  8. python selenium常用基本方法---H5和键盘鼠标操作
  9. 真正在线编辑的在线web编辑器
  10. Error:Cannot access first() element from an empty List