Thanks, @ptrblck!
So to summarize, they are both used to detach tensor from computation graph and returns a tensor that shares the same data, the difference is  x.detach() adds another constrain that when the data is changed in-place, the backward wont’t be done.
So why we still need x.data, it this just a historical reason?