set up datum size for WindowDataLayer
authorRonghang Hu <huronghang@hotmail.com>
Tue, 16 Sep 2014 16:56:11 +0000 (09:56 -0700)
committerRonghang Hu <huronghang@hotmail.com>
Tue, 16 Sep 2014 16:56:11 +0000 (09:56 -0700)
src/caffe/layers/window_data_layer.cpp

index 4284c32..a24d7de 100644 (file)
@@ -158,6 +158,12 @@ void WindowDataLayer<Dtype>::DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
   LOG(INFO) << "output data size: " << (*top)[0]->num() << ","
       << (*top)[0]->channels() << "," << (*top)[0]->height() << ","
       << (*top)[0]->width();
+  // datum size
+  this->datum_channels_ = (*top)[0]->channels();
+  this->datum_height_ = (*top)[0]->height();
+  this->datum_width_ = (*top)[0]->width();
+  this->datum_size_ =
+      (*top)[0]->channels() * (*top)[0]->height() * (*top)[0]->width();
   // label
   (*top)[1]->Reshape(batch_size, 1, 1, 1);
   this->prefetch_label_.Reshape(batch_size, 1, 1, 1);