Is there a convolution function in Tensorflow to apply a Sobel filter?
<p>Is there any <code>convolution</code> method in Tensorflow to apply a Sobel filter to an image <code>img</code> (tensor of type <code>float32</code> and rank 2)?</p>

<pre><code>sobel_x = tf.constant([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], 'float32')
result = tf.convolution(img, sobel_x) # &lt;== TO DO THIS
</code></pre>

<p>I've already seen <code>tf.nn.conv2d</code> but I can't see how to use it for this operation. Is there some way to use <code>tf.nn.conv2d</code> to solve my problem?</p>