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

Method Reshape

src/caffe/layers/lstm_unit_layer.cpp:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20template <typename Dtype>
21void LSTMUnitLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
22 const vector<Blob<Dtype>*>& top) {
23 const int num_instances = bottom[0]->shape(1);
24 for (int i = 0; i < bottom.size(); ++i) {
25 if (i == 2) {
26 CHECK_EQ(2, bottom[i]->num_axes());
27 } else {
28 CHECK_EQ(3, bottom[i]->num_axes());
29 }
30 CHECK_EQ(1, bottom[i]->shape(0));
31 CHECK_EQ(num_instances, bottom[i]->shape(1));
32 }
33 hidden_dim_ = bottom[0]->shape(2);
34 CHECK_EQ(4 * hidden_dim_, bottom[1]->shape(2));
35 top[0]->ReshapeLike(*bottom[0]);
36 top[1]->ReshapeLike(*bottom[0]);
37 X_acts_.ReshapeLike(*bottom[1]);
38}
39
40template <typename Dtype>
41void LSTMUnitLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,

Callers

nothing calls this directly

Calls 4

shapeMethod · 0.80
num_axesMethod · 0.80
ReshapeLikeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected