Very simple version of ReshapeLayer#2088
Conversation
src/caffe/layers/reshape_layer.cpp
Outdated
There was a problem hiding this comment.
@longjon I guess this should technically all be done in LayerSetUp since the top shape doesn't vary with the bottom shape? (But then if special options were added when certain dims of the shape are set to 0 or -1, the top would then vary with the bottom shape, so it would be moved to Reshape then? Maybe better to keep it in Reshape then?)
There was a problem hiding this comment.
Right, to me it feels like this should go in LayerSetUp. If special options were added so that top shape depended on bottom shape, then Reshape would be needed. But that isn't the case in this code.
There was a problem hiding this comment.
Thanks, fixed. I kept the CHECK_EQ for counts in Reshape though, which still seems right.
74020cc to
f45c3c1
Compare
f45c3c1 to
6be7ef9
Compare
Very simple version of ReshapeLayer * jeffdonahue/simple-reshape-layer: Add (very simple version of) ReshapeLayer
|
replaced by #2217 |
(Cherry-picked from my RNN PR -- #2033)
This is a version of
ReshapeLayerthat just takes aBlobShapeand reshapes its input to be that shape. It doesn't have any of the options from #108 or #1263 (infer special defaults when dim is set to 0 or 1 for some axes), but works with the new ND blobs (#1970), and I think the added options toFlattenLayerin #2082 satisfy a lot of the use cases of those options. But I'm happy to see those options added later, or maybe this shouldn't be merged without them? (I was originally in favor of replacingFlattenLayerwithReshapeLayeraltogether, but the implementations are very light (all inSetUp), and I now think it's probably more intuitive just to call a "flatten" layer than figuring out the special dimension values for reshape layer to get the equivalent output.)