BVLC/caffe — pull request #1263 by ssafar (2014-10-11 18:15:52+00:00)
Title: Updated Reshape layer

Here is a layer similar to sguada's #108. Main differences:
* like FlattenLayer, it doesn't copy blobs
* has numpy-like "-1 for automatic dimension inference" and uses the default 0 to copy dimensions from below (just like it was planned in #108)
* is using the latest API.

As for unifying FlattenLayer and this one, also discussed in #108: technically it could be doable but they have really different defaults. For ReshapeLayer, they are 0 0 0 0 (that is, don't change any dimensions unless explicitly requested), while for a FlattenLayer-like default behavior, we'd need 0 -1 1 1 ("keep num, infer channels, flatten everything else). Also, it might be confusing to have something called RESHAPE automatically flatten things or FLATTEN with parameters doing something entirely different from flattening. Or at least that was my reasoning behind creating another layer; it might still be wrong :)

Also, sorry if it's already work in progress by someone; I was looking at the dates on #108, concluded that I'd like to use such a thing most likely sooner than its expected arrival time, and that it might be useful if I posted it if I was going to implement it for myself anyway. Let me know if this wasn't really the right way of doing things :)