2017-02-16 141 views

回答

0

如果vector_size=3

>>> a = tf.placeholder(tf.float32, shape=[vector_size]) 
>>> A = [[a[0],a[1],a[2]],[a[1],a[0],a[1]],[a[2],a[1],a[0]]] 
>>> sess = tf.Session() 
>>> sess.run(A, {a: [1, 2, 3]}) 
[[1.0, 2.0, 3.0], [2.0, 1.0, 2.0], [3.0, 2.0, 1.0]] 
相關問題