TF随笔-10
2024-09-29 05:01:52
#!/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]]
最新文章
- synchronized和ReentrantLock
- iOS 原生态扫描二维码、条形码的功能。
- [UVA11464]Even Parity(状压,枚举)
- Best Practices for Web Apps
- 堆排序 C++
- (一)初识Android
- jQuery mouseover,mouseout事件多次执行的问题处理
- ADO.NET知识的运用一(Day 26)
- 替换NavigationController里面的返回按钮
- linux操作系统简单使用
- 《JavaScript高级程序设计》读书笔记 ---变量、作用域和内存问题小结
- 一个可以提高开发效率的Git命令-- Cherry-Pick
- TCP/IP和HTTP协议代理
- PAT1043:Is It a Binary Search Tree
- SpringBoot启动如何加载application.yml配置文件
- ThreadPoolExecutor系列三——ThreadPoolExecutor 源码解析
- python 包 笔记
- 电脑小白和ta的小白电脑——MySQL数据库
- CentOS 7 yum nginx MySQL PHP7 简易环境搭建(精)
- jmeter对需要登录的接口进行性能测测试
热门文章
- 20145321 《Java程序设计》第3周学习总结
- 20145109 实验四 Andoid开发基础
- [BZOJ4010]菜肴制作
- Codeforces - 828E DNA Evolution —— 很多棵树状数组
- Python学习札记(十二) Function3 函数参数一
- linux用户态与内核态
- bzoj 1270: [BeijingWc2008]雷涛的小猫 简单dp+滚动数组
- python selenium常用基本方法---H5和键盘鼠标操作
- 真正在线编辑的在线web编辑器
- Error:Cannot access first() element from an empty List