def smooth(image, factor):
    'Smooth with the same kernel as ImageFilter.SMOOTH.'
    smooth_kernel = (tf.constant([[1.0, 1.0, 1.0], [1.0, 5.0, 1.0], [1.0, 1.0, 1.0]], dtype=tf.float32, shape=[3, 3, 1, 1]) / 13.0)
    smoothed_im = _convolve_image_with_kernel(image, smooth_kernel)
    return blend(image, smoothed_im, factor)
Smooth with the same kernel as ImageFilter.SMOOTH.
def smooth(image, factor):
    
    smooth_kernel = (tf.constant([[1.0, 1.0, 1.0], [1.0, 5.0, 1.0], [1.0, 1.0, 1.0]], dtype=tf.float32, shape=[3, 3, 1, 1]) / 13.0)
    smoothed_im = _convolve_image_with_kernel(image, smooth_kernel)
    return blend(image, smoothed_im, factor)