title: Image over Image convolution in Tensorflow
body: <p>Assume, I have two set of images, A and B, each 11X5x5x3, where 11 is a number of examples and 5x5x3 is an image dimension.<br>
  Is there an easy way in Tensorflow to apply convolution for each image in A_i over B_i (i.e. B_i plays a filter role and A_i is an input in tf.conv2d)? For example, conv2d(A_1,B_1), conv2d(A_2,B_2),...,conv2d(A_11,B_11)<br>
  No weight learning here just wanted to apply convolution on one image over another. 
  I tried to do it as follow:</p>
  
  <pre><code># change B to 5x5x3x11 to be compatible with tf convolution.
  tf.nn.conv2d(A, B, strides=[1,1,1,1], padding ='SAME' )
  </code></pre>
  
  <p>but the problem with this is that it applies convolution on every A_i over all B_i's. I don't want this, I want A_i only over B_j where i==j. Of course I can do it one by one, but it wouldn't be efficient and I need to do it in a batch mode.</p>
  
  <p>Any comment how to solve this problem?</p>
  
  <p>Thanks.
  J</p>