TensorFlow中的多维多维连接

问题描述 投票:0回答:1

我需要在维度2和3中合并这些张量:

[<tf.Tensor 'one' shape=(3, 3, 15, 30) dtype=float32>, 
<tf.Tensor 'two' shape=(3, 3, 14, 29) dtype=float32>,
<tf.Tensor 'three' shape=(3, 3, 1, 1) dtype=float32>]

我知道在该空间中没有任何意义,但我试图将其重塑为:

[<tf.Tensor 'one' shape=(3, 3, xx) dtype=float32>, 
<tf.Tensor 'two' shape=(3, 3, yy) dtype=float32>,
<tf.Tensor 'three' shape=(3, 3, zz) dtype=float32>]

然后是concat:

[<tf.Tensor 'one' shape=(3, 3, xx+yy+zz) dtype=float32>]

这有意义吗?还有其他想法吗?

tensorflow reshape concat convolution
1个回答
0
投票

您可以将tf.concat的轴参数设置为2。

x = [tensor1, tensor2, tensor3]
tf.concat(x, axis=2)
© www.soinside.com 2019 - 2024. All rights reserved.