projects
/
platform
/
upstream
/
caffeonacl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94179cc
)
LossLayer output is 0D (scalar)
author
Jeff Donahue
<jeff.donahue@gmail.com>
Wed, 26 Nov 2014 07:46:57 +0000
(23:46 -0800)
committer
Jeff Donahue
<jeff.donahue@gmail.com>
Tue, 3 Mar 2015 23:55:13 +0000
(15:55 -0800)
src/caffe/layers/loss_layer.cpp
patch
|
blob
|
history
diff --git
a/src/caffe/layers/loss_layer.cpp
b/src/caffe/layers/loss_layer.cpp
index
a5b6d11
..
3496a5c
100644
(file)
--- a/
src/caffe/layers/loss_layer.cpp
+++ b/
src/caffe/layers/loss_layer.cpp
@@
-24,7
+24,8
@@
void LossLayer<Dtype>::Reshape(
const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) {
CHECK_EQ(bottom[0]->num(), bottom[1]->num())
<< "The data and label should have the same number.";
- top[0]->Reshape(1, 1, 1, 1);
+ vector<int> loss_shape(0); // Loss layers output a scalar; 0 axes.
+ top[0]->Reshape(loss_shape);
}
INSTANTIATE_CLASS(LossLayer);