TensorFlow 合并/连接数组的方法
时间:2022-04-30 09:22:08|栏目:Python代码|点击: 次
如下所示:
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]