| 15 | |
| 16 | template <typename Dtype> |
| 17 | void LossLayer<Dtype>::Reshape( |
| 18 | const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { |
| 19 | CHECK_EQ(bottom[0]->shape(0), bottom[1]->shape(0)) |
| 20 | << "The data and label should have the same first dimension."; |
| 21 | vector<int> loss_shape(0); // Loss layers output a scalar; 0 axes. |
| 22 | top[0]->Reshape(loss_shape); |
| 23 | } |
| 24 | |
| 25 | INSTANTIATE_CLASS(LossLayer); |
| 26 |