net.state_dict() will return a view on the network’s parameters as tensors. optimizer.step() updates the network and the view preParams will also get the update. If you use
preParams = {k:v.clone() for k,v in net.state_dict().items()}

instead, it will work as you expect.
Best regards
Thomas