| 7 | |
| 8 | template <typename Dtype> |
| 9 | void SplitLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, |
| 10 | const vector<Blob<Dtype>*>& top) { |
| 11 | count_ = bottom[0]->count(); |
| 12 | for (int i = 0; i < top.size(); ++i) { |
| 13 | // Do not allow in-place computation in the SplitLayer. Instead, share data |
| 14 | // by reference in the forward pass, and keep separate diff allocations in |
| 15 | // the backward pass. (Technically, it should be possible to share the diff |
| 16 | // blob of the first split output with the input, but this seems to cause |
| 17 | // some strange effects in practice...) |
| 18 | CHECK_NE(top[i], bottom[0]) << this->type() << " Layer does not " |
| 19 | "allow in-place computation."; |
| 20 | top[i]->ReshapeLike(*bottom[0]); |
| 21 | CHECK_EQ(count_, top[i]->count()); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | template <typename Dtype> |
| 26 | void SplitLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
nothing calls this directly
no test coverage detected