summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 865a60c)
raw | patch | inline | side by side (parent: 865a60c)
author | Yangqing Jia <jiayq84@gmail.com> | |
Sat, 28 Sep 2013 00:08:45 +0000 (17:08 -0700) | ||
committer | Yangqing Jia <jiayq84@gmail.com> | |
Sat, 28 Sep 2013 00:08:45 +0000 (17:08 -0700) |
src/caffe/blob.cpp | patch | blob | history |
diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp
index 35e5b04adbddc82585733defb6eb5d25529ef9c5..d31ba72bfc93c04ae978156c05981828667b45f2 100644 (file)
--- a/src/caffe/blob.cpp
+++ b/src/caffe/blob.cpp
template <typename Dtype>
void Blob<Dtype>::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);
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<SyncedMemory*>(NULL));
diff_.reset(reinterpret_cast<SyncedMemory*>(NULL));