tf.where()函数
来源:互联网 发布:人工智能最新消息 编辑:程序博客网 时间:2024/06/04 00:25
tf.where()定义如下:
where(condition, x=None, y=None,name=None)
condition:一个Tensor,数据类型为tf.bool类型
如果x、y均为空,那么返回condition中值为True的位置的Tensor:例如:x就是condition,y是返回值
x中值为True的位置有[0,0,0],[0,1,1],[0,2,0],[0,2,1],[1,0,1],[1,1,0],[1,2,0]。
如果x、y不为空,那么x、y必须有相同的形状。如果x、y是标量,那么condition参数也必须是标量。如果x、y是向量,那么condition必须和x的第一维有相同的形状或者和x形状一致。
返回值:如果x、y不为空的话,返回值和x、y有相同的形状,如果condition对应位置值为True那么返回Tensor对应位置为x的值,否则为y的值. 例子:
阅读全文
0 0
- tf.where()函数
- tf.where(a,b,c)函数
- tf.where 实例
- tf.where 实例2
- tf.where 和 tf.cond对比
- tf函数
- 常用tf函数汇总
- 【Tensorflow】tf.placeholder函数
- 【Tensorflow】tf.reshape 函数
- 【Tensorflow】tf.argmax函数
- tf.argmax函数
- Tensorflow tf.placeholder函数
- tf.strided_slice函数
- tf.transpose()函数
- tf.nn函数总结
- tf函数说明
- 【Tensorflow】tf.Graph()函数
- tf.nn.embedding_lookup函数
- “数据库事务(Database Transaction)
- 【Scikit-Learn 中文文档】高斯混合模型
- 寄存器。。。。各种
- 预算管理
- python 文件
- tf.where()函数
- centos7 点滴
- git文档管理总结
- leetcode解题方案--056--Merge Intervals
- Timer学习笔记
- 【笔记】图的存储结构
- python基本知识、数据库、网络、编程等总结
- 彻底清除Github上某个文件的历史(针对误上传密码文件等情况)
- Algorithm-week13