title: Repeating a matrix's columns using the padding function in Tensorflow
body: <p>I have written the following function:</p>
  
  <pre><code>A = tf.constant([[1,2,3,4,4,5,6,7,2],[4,5,6,6,4,5,6,7,2],[6,7,8,9,4,5,6,7,2]])
  B = tf.constant([[19,15],
               [18,14],
               [17,13]])
  
  diff = A.get_shape()[1] - B.get_shape()[1]
  
  Bt = tf.transpose(B)
  for idx in range(diff):
      col = tf.gather_nd(Bt, [[idx]])
      Bt = tf.concat(0, [Bt, col])
  
  result = tf.transpose(Bt)
  
  with tf.Session() as sess:
      res = sess.run(result)
      print(res)
  </code></pre>
  
  <p>the idea is that A is a wider matrix than B. I want to widen B by repeated copies of itself (should also work when the row-length of A does not exactly divide the one of B).</p>
  
  <p>If you run the above code, you get:</p>
  
  <pre><code>[[19 15 19 15 19 15 19 15 19]
   [18 14 18 14 18 14 18 14 18]
   [17 13 17 13 17 13 17 13 17]]
  </code></pre>
  
  <p>Any idea on how this can be done just by using tensorflow functions? </p>