tf.reduce_mean function usage and interesting difference

= tf.Session Sess () 

A = np.array ([1, 2,3,5.]) # This code is reserved as a floating point

a1 = np.array ([1,2,3,5]) # code leave integer
c=tf.reduce_mean(a)
d=sess.run(c)
print(a)
print(d)
c1=tf.reduce_mean(a1)
d1=sess.run(c1)
print(a1)
print(d1)


Summary: tf.reduce_mean (a, axis) is the mean, where a is the input matrix, axis averaging from what is the dimension. However, the code running discovery, a is floating point format and floating point number, a is an integer, is an integer of return taken down.



 

Guess you like

Origin www.cnblogs.com/tangjunjun/p/11513114.html