当前位置: 移动技术网 > IT编程>脚本编程>Python > TensorFlow 合并/连接数组的方法

TensorFlow 合并/连接数组的方法

2018年08月08日  | 移动技术网IT编程  | 我要评论

天天2088第一季,不爱你走,悠世新浪博客

如下所示:

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 合并/连接数组的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网