replace all memcpy by caffe_copy