Skip to content

Commit

Permalink
removing redundant function in blob
Browse files Browse the repository at this point in the history
  • Loading branch information
dutran committed Jul 17, 2015
1 parent 07b83c9 commit 430d43b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion include/caffe/blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/caffe/blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,6 @@ void Blob<Dtype>::ToProto(BlobProto* proto, bool write_diff) const {
}
}

template <typename Dtype>
void Blob<Dtype>::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
Expand Down
3 changes: 2 additions & 1 deletion src/caffe/layers/video_data_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ void VideoDataLayer<Dtype>::SetUp(const vector<Blob<Dtype>*>& 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());
}
}

Expand Down

0 comments on commit 430d43b

Please sign in to comment.