TensorFlow 合并_连接数组的方法
来源:
中文源码网 浏览:169 次 日期:2024-04-29 17:43:37
【下载文档: TensorFlow 合并_连接数组的方法.txt 】
TensorFlow 合并/连接数组的方法
如下所示:
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]
以上这篇TensorFlow 合并/连接数组的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持中文源码网。