Please check the documentation for add 4.
The inplace version of torch.add(input, value=1, other, out=None)  is input.add_(value=1, other, out=None). So p.data.add_(-group['lr'], d_p) is p.data.add_(value=-group['lr'], other=d_p).
I feel this kind of APIs is followed most of the vectorized operation design.