import cv2
import keras.backend as K
import tensorflow as tf
a = K.variable(np.array([[1 , 2, 3]]))
b = K.variable(np.array([[3 , 2, 1]]))
c1 = K.concatenate([a , b] , axis=0)
c2 = K.concatenate([a , b] , axis=-1)
with tf.Session() as sess:
sess.run(init)
print(sess.run(c1))
print(sess.run(c2))
# [3. 2. 1.]]
# [[1. 2. 3. 3. 2. 1.]]
---------------------
作者:韋頁
来源:CSDN
原文:https://blog.csdn.net/hanshuobest/article/details/79488209
版权声明:本文为博主原创文章,转载请附上博文链接!
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:keras.layers.concatenate 拼接 - Python技术站