In BasePrefetchingDataLayer::Forward_cpu hanged top[0]->Reshape to
authormax argus <argus.max@gmail.com>
Thu, 20 Aug 2015 09:01:58 +0000 (09:01 +0000)
committermax argus <argus.max@gmail.com>
Thu, 20 Aug 2015 09:01:58 +0000 (09:01 +0000)
top[0]->ReshapeLike, in line with other calls.

src/caffe/layers/base_data_layer.cpp

index 5303fe9..b90bd4e 100644 (file)
@@ -105,8 +105,7 @@ void BasePrefetchingDataLayer<Dtype>::Forward_cpu(
     const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) {
   Batch<Dtype>* batch = prefetch_full_.pop("Data layer prefetch queue empty");
   // Reshape to loaded data.
-  top[0]->Reshape(batch->data_.num(), batch->data_.channels(),
-      batch->data_.height(), batch->data_.width());
+  top[0]->ReshapeLike(batch->data_);
   // Copy the data
   caffe_copy(batch->data_.count(), batch->data_.cpu_data(),
              top[0]->mutable_cpu_data());