You could use torch.randperm to permute the indices and then select the desired percentage of them to manipulate your tensor:
x = torch.tensor([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
p = 0.2
idx = torch.randperm(x.size(0))[:int(x.size(0)*p)]
x[idx] += 10.
print(idx, x)