MCPcopy Create free account
hub / github.com/BVLC/caffe / Reshape

Method Reshape

src/caffe/layers/split_layer.cpp:9–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8template <typename Dtype>
9void 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
25template <typename Dtype>
26void SplitLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,

Callers

nothing calls this directly

Calls 4

typeMethod · 0.95
countMethod · 0.80
ReshapeLikeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected