我想初始化张量变量数组以通过tf.concat
存储值。
尺寸为(?,)时,首字母为tf.Variable([])
。
尺寸为(?,512)呢?
非常感谢你!
答案 0 :(得分:1)
我成功做到了
#Initialize Variable
center_features= tf.Variable(tf.zeros([1,512]),dtype=tf.float32)
#Add vector
center_features= tf.concat([center_features,added_vectors])
#Cheat remove the first redundant vector
m = tf.range(1, tf.shape(center_features)[0], 1)
center_feature = tf.gather(center_features,m)