Hi,
thanks for the quick answer.
well, I do not create a new parameter object. The longer story is that the parameter is inside a model that is training, and an optimizer is used for training. I do not want to create a new parameter because then I would also need to re-create a new optimizer each time, whereas if I could only expand the inner data I could keep using the same optimizer.
(I adapted the optimizer code to deal with “expanding” gradients, needed for methods like sgd with momentum)