如:
t1 = [[1, 2, 3], [4, 5, 6]]
t2 = [[7, 8, 9], [10, 11, 12]]
#按照第0维连接
tf.concat(0, [t1, t2]) == [[1..., 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
#按照第1维连接
tf.concat(1, [t1, t2]) == [[1, 2, 3, 7, 8, 9],...]
t2 = [[7, 8, 9], [10, 11, 12]]
#按照第0维连接
tf.concat( [t1, t2],0) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]...注意:tf.pack已经变成了tf.stack
3.tf.reshape
用法:reshape(tensor, shape, name=None):主要通过改变张量形状,可以从高维变低维,也可以从低维变高维...中的reshape(tensor,[1,-1])和reshape(tensor,[-1,1])
和python 中的reshape用法应该一样
import tensorflow as tf
a = [