title: How to rotate images at different angles randomly in tensorflow
body: <p>I know that I can rotate images in tensorflow using <code>tf.contrib.image.rotate</code>. But suppose I want to apply the rotation randomly at an angle between -0.3 and 0.3 in radians as follows:</p>
  
  <pre><code>images = tf.contrib.image.rotate(images, tf.random_uniform(shape=[batch_size], minval=-0.3, maxval=0.3, seed=mseed), interpolation='BILINEAR')
  </code></pre>
  
  <p>So far this will work fine. But the problem arises when the batch size changes on the last iteration and I got an error. So how to fix this code and make it work in all case scenarios? Please note that the inputs images are fed using <code>tf.data.Dataset</code> api.</p>
  
  <p>Any help is much appreciated!!</p>