Try not to use in-place value assignment, which easily breaks the underlying graph. Thus, no gradients back-propagated.
Try:
thought = []
for i in range(something):
thought.append(output.clone().unsqueeze(1))
thought_vector = torch.stack(thought)