zero_padding = tf.zeros([2 * 3] - tf.shape(a_as_vector), dtype=a.dtype)
a_padded = tf.concat(0, [a_as_vector, zero_padding])
result = tf.reshape(a_padded, [2, 3])
Tensorflow Tensor reshape and pad with zeros