Do you have a copy-paste error or are you executing the for loop over lstm_len+1 twice?
If that’s not an error, then the second loop would overwrite the values, which raises this error.
Could you explain the use case why you would need to create these values twice?