TensorFlow里的算子round不是什么四舍五入,而是Bankers Rounding——四舍六入五取偶
import tensorflow as tf
from keras import backend as K
x = tf.constant([0.9, 2.5, 2.3, 1.5, -4.5])
with tf.Session() as sess:
sess.run(tf.round(x))
# array([ 1., 2., 2., 2., -4.], dtype=float32)
K.round()底层即为tf.round()