tf.concat(
values,
axis,
name='concat'
)
沿一维串联张量。沿着维度axis连接张量列表values。...例:
import tensorflow as tf
t1 = [[1, 2, 3], [4, 5, 6]]
t2 = [[7, 8, 9], [10, 11, 12]]
t3=tf.concat([...t1, t2], 0) # [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
t4=tf.concat([t1, t2], 1) # [[1, 2, 3...6, 10, 11, 12]]
# tensor t3 with shape [2, 3]
# tensor t4 with shape [2, 3]
t3_shape = tf.shape(tf.concat...([t1, t2], 0)) # [4, 3]
t4_shape = tf.shape(tf.concat([t1, t2], 1)) # [2, 6]
with tf.Session() as