| 47 | |
| 48 | template <typename Dtype> |
| 49 | void EmbedLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, |
| 50 | const vector<Blob<Dtype>*>& top) { |
| 51 | // Figure out the dimensions |
| 52 | M_ = bottom[0]->count(); |
| 53 | vector<int> top_shape = bottom[0]->shape(); |
| 54 | top_shape.push_back(N_); |
| 55 | top[0]->Reshape(top_shape); |
| 56 | // Set up the bias multiplier |
| 57 | if (bias_term_) { |
| 58 | vector<int> bias_shape(1, M_); |
| 59 | bias_multiplier_.Reshape(bias_shape); |
| 60 | caffe_set(M_, Dtype(1), bias_multiplier_.mutable_cpu_data()); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | template <typename Dtype> |
| 65 | void EmbedLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
nothing calls this directly
no test coverage detected