def solarize_add(image, addition=0, threshold=128):
    threshold = tf.saturate_cast(threshold, image.dtype)
    added_im = (tf.cast(image, tf.int32) + tf.cast(addition, tf.int32))
    added_im = tf.saturate_cast(added_im, tf.uint8)
    return tf.where((image < threshold), added_im, image)
def solarize_add(image, addition=0, threshold=128):
    threshold = tf.saturate_cast(threshold, image.dtype)
    added_im = (tf.cast(image, tf.int32) + tf.cast(addition, tf.int32))
    added_im = tf.saturate_cast(added_im, tf.uint8)
    return tf.where((image < threshold), added_im, image)