I’ve tried to locate the error in your code, but couldn’t find the right place.
Could you explain a bit where the error occurs?
The seeding and generation of perturbation is deterministic:
torch.manual_seed(s)
perturbation = torch.ones_like(p).normal_()
print(perturbation)

This results in exact the same values for each run.