Reputation: 4353
I have a for loop that creates vectors (tf tensors) of equal length, say
a1 = [0, 2, 4 ... ]
a2 = [1, 4, 6 ... ]
...
and I want to concatenate these vectors into a matrix, along the 0th axis
matrix = [[0,2,4...] , [1,4,6...] ... ]
I can do a
matrix = tf.concat(0, [matrix, a])
inside the for loop. However the first iteration does not work, since matrix does not exist and if I initialize it to a vector, I'm stuck with that vector at the top of the end matrix. Is there a quick way of doing this?
Upvotes: 0
Views: 1179