supporting N-D Blobs in Dropout layer Reshape
authorshai <shai@magisto.com>
Thu, 25 Feb 2016 10:09:45 +0000 (12:09 +0200)
committershai <shai@magisto.com>
Sun, 28 Feb 2016 06:53:18 +0000 (08:53 +0200)
fixing lint errors

src/caffe/layers/dropout_layer.cpp

index 9cb64d9..533ab26 100644 (file)
@@ -23,8 +23,8 @@ void DropoutLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
       const vector<Blob<Dtype>*>& top) {
   NeuronLayer<Dtype>::Reshape(bottom, top);
   // Set up the cache for random number generation
-  rand_vec_.Reshape(bottom[0]->num(), bottom[0]->channels(),
-      bottom[0]->height(), bottom[0]->width());
+  // ReshapeLike does not work because rand_vec_ is of Dtype uint
+  rand_vec_.Reshape(bottom[0]->shape());
 }
 
 template <typename Dtype>