diff --git a/include/caffe/blob.hpp b/include/caffe/blob.hpp index 7e59bce16b..e5cdc32529 100644 --- a/include/caffe/blob.hpp +++ b/include/caffe/blob.hpp @@ -112,7 +112,6 @@ class Blob { void FromProto(const BlobProto& proto); void Lift3DFromProto(const BlobProto& proto, const int l); void ToProto(BlobProto* proto, bool write_diff = false) const; - void SetAllValue(Dtype val); // Set the data_/diff_ shared_ptr to point to the SyncedMemory holding the // data_/diff_ of Blob other -- useful in layers which simply perform a copy diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp index d7e86478c0..19fdbae6e5 100644 --- a/src/caffe/blob.cpp +++ b/src/caffe/blob.cpp @@ -225,14 +225,6 @@ void Blob::ToProto(BlobProto* proto, bool write_diff) const { } } -template -void Blob::SetAllValue(Dtype val){ - Dtype* data_vec = mutable_cpu_data(); - for (int i = 0; i < count_; ++i) { - data_vec[i] = (Dtype)val; - } -} - INSTANTIATE_CLASS(Blob); } // namespace caffe diff --git a/src/caffe/layers/video_data_layer.cpp b/src/caffe/layers/video_data_layer.cpp index 49ce77423e..2332683274 100644 --- a/src/caffe/layers/video_data_layer.cpp +++ b/src/caffe/layers/video_data_layer.cpp @@ -398,7 +398,8 @@ void VideoDataLayer::SetUp(const vector*>& bottom, data_mean_.Reshape(1, datum_channels_, datum_length_, datum_height_, datum_width_); if (this->layer_param_.image_data_param().has_mean_value()){ LOG(INFO) << "Using mean value of " << this->layer_param_.image_data_param().mean_value(); - data_mean_.SetAllValue(this->layer_param_.image_data_param().mean_value()); + caffe::caffe_set(data_mean_.count(), (Dtype)this->layer_param_.image_data_param().mean_value(), + (Dtype*)data_mean_.mutable_cpu_data()); } }