title: Tensorflow: Convolutions with different filter for each sample in the mini-batch
body: <p>I would like to have a 2d convolution with a filter which depends on the sample in the mini-batch in tensorflow. Any ideas how one could do that, especially if the number of sample per mini-batch is not known? </p>
  
  <p>Concretely, I have input data <code>inp</code> of the form <code>MB x H x W x Channels</code>, and I have filters <code>F</code> of the form <code>MB x fh x fw x Channels x OutChannels</code>.</p>
  
  <p>It is assumed that </p>
  
  <p><code>inp = tf.placeholder('float', [None, H, W, channels_img], name='img_input')</code>.</p>
  
  <p>I would like to do <code>tf.nn.conv2d(inp, F, strides = [1,1,1,1])</code>, but this is not allowed because <code>F</code> cannot have a mini-batch dimension. Any idea how to solve this problem? </p>