Created by: tianbingsz
Fixes https://github.com/PaddlePaddle/Paddle/issues/566
With this PR, we can write code to directly deep swap the content of Vector and Matrix under the constraint of not allowing changing the data_ pointers. Here is the example code to deep swap two Vectors,
para->getBuf(PARAMETER_SNAPSHOT_VALUE)->deepSwap(*para->getBuf(PARAMETER_VALUE))
and this is for the Matrices,
MatrixPtr cpuA = std::make_shared<CpuMatrix>(height, width);
MatrixPtr cpuB = std::make_shared<CpuMatrix>(height, width);
cpuA->deepSwap(*cpuB);