Can't declare an integer loop variable

You can set the test value like this:

i = tt.lscalar('loop_index')
i.tag.test_value=0

But in most case you don’t need index in theano scan, you just pass the sequence or the thing you would like to compute iterately as input