如何使用张量流将 [1,2,3,4,5,6] 重塑为 [[1,3,5],[2,4,6]]?
How to use tensor-flow to reshape [1,2,3,4,5,6] into [[1,3,5],[2,4,6]]?
我知道以下声明:
tf.reshape([1,2,3,4,5,6],[2, 3]) will get [[1,2,3], [4,5,6]]
但是如何得到[[1,3,5],[2,4,6]]
?
尝试:
tf.transpose( tf.reshape( [1,2,3,4,5,6],[3,2]))
应该可以,至少在 numpy 中可以。
我知道以下声明:
tf.reshape([1,2,3,4,5,6],[2, 3]) will get [[1,2,3], [4,5,6]]
但是如何得到[[1,3,5],[2,4,6]]
?
尝试:
tf.transpose( tf.reshape( [1,2,3,4,5,6],[3,2]))
应该可以,至少在 numpy 中可以。