I understand. Yet, execution fails because of the change in #timeSteps from one iteration to the next. You saw the error message.
I thought that defining the weight variable as a placeholder would resolve the problem. However, I don’t know how to assign a value to a placeholder variable.
I thought you suggested to take the approach of defining weights as a placeholder in this thread: