我有兩個張量:通過克隆一個張量連接3D張量?
a = tf.placeholder(tf.float32, [None, 20, 100])
b = tf.placeholder(tf.float32, [None, 1, 100])
我要追加到b
a[i, 20, 100]
,創造c
爲c
這樣有[None, 20, 200]
的形狀。
這似乎很簡單,但我還沒有想出如何與tf.concat
做到這一點:
tf.concat(0, [a, b]) -> Shapes (20, 100) and (1, 100) are not compatible
tf.concat(1, [a, b]) => shape=(?, 28, 100) which is not what I wanted
tf.concat(2, [a, b]) -> Shapes (?, 20) and (?, 1) are not compatible
我需要重塑a
和b
第一然後Concat的?
您需要之前'tf.concat' – martianwars