You can find the docs for torch.tensor.grad here 24.
I wouldn’t recommend to use .data, but instead wrap your code in a torch.no_grad() block, if you would like to manipulate the data:
with torch.no_grad():
    module.weight[0, 0] = 1