You could pre-allocate output as an empty tensor and fill it using the index.
Something like this should work:
output = torch.empty(hx.size(0), 1000)
for i in range(1000):
    output[:, i] = hx

I’m not sure, how hx is shaped in your case, so probably you would need to adapt your code a bit.