@nouiz : I am not sure I understood this comment well.  Would it be possible for you to point me to a sample code in Theano where something similar is done.