Update tensor_random.h

update patch by in #7 by @reyoung . buffer_.Resize is dangerous because it could potentially change the content of data