I am trying to run a loop based on the size of the array. how to do that in tensorflow ? For example
# input pipeline with all files available in the folder
a = tf.Variable([1,2,3,4,5],dtype = tf.int32)
loop = tf.size(a)
....
for i in range(loop):
print(sess.run(a))
I wanted to print the array a for 5 times. but it says loop is a tensor object and cannot taken as integer. I have tried taking the loop variable as
loop = tf.cast(tf.size(a),tf.int32),
loop = tf.shape_n(a),
loop = tf.shape(a)[0]
it has the same error.