Replace `Flatten` nodes w/corresponding leaf node
Replace `Flatten` nodes w/corresponding leaf node

 - Replace `Flatten` nodes with corresponding leaf node.
 - This change removes `identity` wrapper around map vector, making resulting
   `permututation_iterator` writable.  This enables, for example, permutation
   scatter.

cfobel/theano-helpers,cfobel/theano-helpers