replace remaining uses of rand() with caffe_rng_rand()