def _convolve_image_with_kernel(image, kernel):
    num_channels = tf.shape(image)[(- 1)]
    kernel = tf.tile(kernel, [1, 1, num_channels, 1])
    image = tf.expand_dims(image, axis=0)
    convolved_im = tf.nn.depthwise_conv2d(tf.cast(image, tf.float32), kernel, strides=[1, 1, 1, 1], padding='SAME')
    convolved_im = (convolved_im + 0.5)
    return tf.squeeze(convolved_im, axis=0)
def _convolve_image_with_kernel(image, kernel):
    num_channels = tf.shape(image)[(- 1)]
    kernel = tf.tile(kernel, [1, 1, num_channels, 1])
    image = tf.expand_dims(image, axis=0)
    convolved_im = tf.nn.depthwise_conv2d(tf.cast(image, tf.float32), kernel, strides=[1, 1, 1, 1], padding='SAME')
    convolved_im = (convolved_im + 0.5)
    return tf.squeeze(convolved_im, axis=0)