diff options
author | Jeff Donahue <jeff.donahue@gmail.com> | 2014-04-08 16:24:50 -0700 |
---|---|---|
committer | Jeff Donahue <jeff.donahue@gmail.com> | 2014-04-08 20:17:17 -0700 |
commit | 2ebe94eca73ad45ba7dcc1014c9eb3d46b136501 (patch) | |
tree | 0d1e5ed28384f03ec38e59fe008d23862406a34c /src/caffe/layers/dropout_layer.cpp | |
parent | acfafb2f3940f05b95daeaaada7f13ecf66b4699 (diff) | |
download | caffeonacl-2ebe94eca73ad45ba7dcc1014c9eb3d46b136501.tar.gz caffeonacl-2ebe94eca73ad45ba7dcc1014c9eb3d46b136501.tar.bz2 caffeonacl-2ebe94eca73ad45ba7dcc1014c9eb3d46b136501.zip |
add analogous caffe_gpu_rng_* functions for gaussian and uniform, and
add test cases
Diffstat (limited to 'src/caffe/layers/dropout_layer.cpp')
-rw-r--r-- | src/caffe/layers/dropout_layer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/caffe/layers/dropout_layer.cpp b/src/caffe/layers/dropout_layer.cpp index e0068fed..e28cab33 100644 --- a/src/caffe/layers/dropout_layer.cpp +++ b/src/caffe/layers/dropout_layer.cpp @@ -20,7 +20,7 @@ void DropoutLayer<Dtype>::SetUp(const vector<Blob<Dtype>*>& bottom, DCHECK(threshold_ > 0.); DCHECK(threshold_ < 1.); scale_ = 1. / (1. - threshold_); - uint_thres_ = (unsigned int)(UINT_MAX * threshold_); + uint_thres_ = static_cast<unsigned int>(UINT_MAX * threshold_); } template <typename Dtype> @@ -37,7 +37,7 @@ Dtype DropoutLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, top_data[i] = bottom_data[i] * mask[i] * scale_; } } else { - memcpy(top_data, bottom_data, bottom[0]->count() * sizeof(Dtype)); + caffe_copy(bottom[0]->count(), bottom_data, top_data); } return Dtype(0); } |