lisa-lab/pylearn2 — pull request #476 by SuperElectric (2013-12-03 22:54:16+00:00)
Title: Updated CompositeSpace's np_format_as, _format_as to support formatting to another CompositeSpace.

In CompositeSpace.np_format_as(batch, target), if is another CompositeSpace, recursively call:

self_leaf.np_format_as(batch_leaf, target_leaf)

For corresponding leaf nodes in the composite data tree structure.

Made equivalent changes to _format_as().

Also changed VectorSpace._format_as() so that it no longer throws an exception if you try to format to another VectorSpace with identical params. It now returns the batch unchanged.