From e9caecb427276da2022d75d900977389f70ddca6 Mon Sep 17 00:00:00 2001 From: Yangqing Jia Date: Fri, 27 Sep 2013 17:08:45 -0700 Subject: [PATCH] blob cpp bugfix --- src/caffe/blob.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp index 35e5b04..d31ba72 100644 --- a/src/caffe/blob.cpp +++ b/src/caffe/blob.cpp @@ -12,7 +12,6 @@ namespace caffe { template void Blob::Reshape(const int num, const int channels, const int height, const int width) { - int old_count = count_; CHECK_GE(num, 0); CHECK_GE(channels, 0); CHECK_GE(height, 0); @@ -23,10 +22,8 @@ void Blob::Reshape(const int num, const int channels, const int height, width_ = width; count_ = num_ * channels_ * height_ * width_; if (count_) { - if (old_count != count_) { - data_.reset(new SyncedMemory(count_ * sizeof(Dtype))); - diff_.reset(new SyncedMemory(count_ * sizeof(Dtype))); - } + data_.reset(new SyncedMemory(count_ * sizeof(Dtype))); + diff_.reset(new SyncedMemory(count_ * sizeof(Dtype))); } else { data_.reset(reinterpret_cast(NULL)); diff_.reset(reinterpret_cast(NULL)); -- 2.7.4