Idem for the handling of shared variable, the indexing should be in the theano fct.