num in blob is deprecated
authorFisher Yu <i@yf.io>
Sun, 7 Aug 2016 03:01:45 +0000 (23:01 -0400)
committerFisher Yu <i@yf.io>
Sun, 7 Aug 2016 03:01:45 +0000 (23:01 -0400)
src/caffe/layers/loss_layer.cpp

index c0b7a86..afb1ce9 100644 (file)
@@ -16,8 +16,8 @@ void LossLayer<Dtype>::LayerSetUp(
 template <typename Dtype>
 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.";
+  CHECK_EQ(bottom[0]->shape(0), bottom[1]->shape(0))
+      << "The data and label should have the same first dimension.";
   vector<int> loss_shape(0);  // Loss layers output a scalar; 0 axes.
   top[0]->Reshape(loss_shape);
 }