One official tutorial has below comment

# An alternative way is to operate on **weight.data** and **weight.grad.data**.
# Recall that tensor.data gives a tensor that shares the storage with
# tensor, but doesn't track history.


https://github.com/pytorch/tutorials/blob/7f48ac827389f3438113c1604ac416cca3c1090e/beginner_source/examples_autograd/two_layer_net_autograd.py#L59-L72 32
The requires_grad of weight is True, we get a tensor sharing same underlying data with weight by weight.data,  but this tensor’s requires_grad is False.
Since weight.grad is untracking tensor (requires_grad = False), It seems that weight.grad.data is same with weight.grad.
In a word, .data or .detach() is used for variable tensor i.e. requires_grad is True, for other tensor, it do nothing.
Please corret me.