【TensorFlow】tf.concat
来源:互联网 发布:webservice添加数据 编辑:程序博客网 时间:2024/06/05 20:15
https://www.tensorflow.org/versions/master/api_docs/python/tf/concat
功能:在某一维度上连接两个矩阵。
具体用法:
eg:
a1=[[[1,2],[2,3],[3,4]],[[4,5],[5,6],[6,7]]]
a2=[[[9,8],[8,7],[7,6]],[[6,5],[5,4],[4,3]]]
print(sess.run(tf.concat([a1,a2],0)))
[[[1 2]
[2 3]
[3 4]]
[[4 5]
[5 6]
[6 7]]
[[9 8]
[8 7]
[7 6]]
[[6 5]
[5 4]
[4 3]]]
print(sess.run(tf.concat([a1,a2],1)))
[[[1 2]
[2 3]
[3 4]
[9 8]
[8 7]
[7 6]]
[[4 5]
[5 6]
[6 7]
[6 5]
[5 4]
[4 3]]]
print(sess.run(tf.concat([a1,a2],2)))
[[[1 2 9 8]
[2 3 8 7]
[3 4 7 6]]
[[4 5 6 5]
[5 6 5 4]
[6 7 4 3]]]
规律:这个矩阵的合并和c语言以及MATLAB里面的按行或列合并不一样。前n-1维需要把最小单元当成一个整体(例如本例中[[1,2],[2,3],[3,4]]为一个最小单元)
*实在不能理解是如何合并的,只能跟着例程自己找规律
阅读全文
0 0
- tensorflow tf.concat操作
- 【TensorFlow】tf.concat
- 【Tensorflow】tf.concat函数
- tensorflow API: tf.concat
- 【TensorFlow】tf.concat的用法
- tensorflow错误记录:tf.concat
- tensorflow错误记录:tf.concat
- tensorflow 中tf.concat()用法
- tensorflow错误记录:tf.concat
- 【TensorFlow】tf.concat的用法
- Tensorflow API 学习(1)-tf.concat()
- TensorFlow 介绍 tf.concat 的使用方法
- tf.concat
- tf.concat
- tf.concat()
- tensorflow concat
- tf.concat的用法
- tf.concat的用法
- spring事务实用开发
- awk 求和、最大、最小、平均值
- 0-1背包问题动态规划详解
- [51nod1190]最小公倍数之和V2
- openCV学习系列1:我为什么要学习openCV,什么是openCV
- 【TensorFlow】tf.concat
- NOIP 2009 Senior 3
- U3D中在Grid中增加和修改Cell的部分代码
- hdu2068错排+排列组合
- python笔记3_集合与字典
- 机器学习与深度学习(三) 支持向量机 (Support Vector Machine) SVM
- imageloader
- redis 安装和简单使用
- TdxDockPanel