gdesjardins/Theano — comment on commit 9311f05d295010c5a847a2683795942f2ad24192
File: theano/tensor/opt.py line 1372
By gdesjardins:

I don't think that would require a difference implementation. Mine simply takes u.broascastable (output of Rebroadcast, input to Subtensor) and drops the dimensions as required by the Subtensor. I do this in two steps:
* looping from 0 to length of idx_list (covering all the slices provided to Subtensor, and dropping dimensions as required)
* looping from length of idx_list, to len(u.broadcastable). The broadcastable flag of these dimensions is unchanged by Subtensor: only their position changes: this is taken into account by "j" (which is incremented for every dimension we keep).