TensorFlow 合并/连接数组的方法

作者:猪哥 2018-07-28

如下所示:

import tensorflow as tf

a = tf.Variable([4,5,6])
b = tf.Variable([1,2,3])

c = tf.concat(0,[a,b])

init_op = tf.initialize_all_variables()

with tf.Session() as sess:
 sess.run(init_op)
 print(sess.run(c))

结果打印:

[4 5 6 1 2 3]

相关文章

精彩推荐