You can do that (before you use the layer) if you want and then use something like
with torch.no_grad():
   # you might also do the computation of new_value  here
   self.nex_layer.my_param.copy_(new_value)

or so.
Best regards
Thomas