| 26 | |
| 27 | template <typename Dtype> |
| 28 | void LSTMLayer<Dtype>::RecurrentInputShapes(vector<BlobShape>* shapes) const { |
| 29 | const int num_output = this->layer_param_.recurrent_param().num_output(); |
| 30 | const int num_blobs = 2; |
| 31 | shapes->resize(num_blobs); |
| 32 | for (int i = 0; i < num_blobs; ++i) { |
| 33 | (*shapes)[i].Clear(); |
| 34 | (*shapes)[i].add_dim(1); // a single timestep |
| 35 | (*shapes)[i].add_dim(this->N_); |
| 36 | (*shapes)[i].add_dim(num_output); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | template <typename Dtype> |
| 41 | void LSTMLayer<Dtype>::OutputBlobNames(vector<string>* names) const { |