2017-05-01 27 views

回答

1

您需要使用tf.reduce_prod(x, 0),因爲你沿着列乘數字:

import tensorflow as tf 
a = tf.constant([ 
    [1, 2, 3], 
    [4, 5, 6], 
    [7, 8, 9] 
]) 
b = tf.reduce_prod(a, 0) 

with tf.Session() as sess: 
    print sess.run(b)