TenSorFlow-除法


import tensorflow as tf
a=tf.constant(5)
b=tf.constant(3)
res1=tf.divide(a,b)
res2=tf.div(a,b)
with tf.Session() as sess:
    print sess.run(res1)
    print sess.run(res2)

输出:

1.66666666667
1

猜你喜欢

转载自blog.51cto.com/13959448/2339019