Time Series Transformer generate error when input_size = 1
Author: ricardokleinklein
Pull request: no

### System Info

Related to #22827 (@kashif ?). In the solution proposed there as an example, when setting input_size = 1, the model crashes (log below). 

```
Traceback (most recent call last):
  File "/Users/ricardokleinlein/Desktop/univariate_probabilisticTransformer.py", line 182, in <module>
    main()
  File "/Users/ricardokleinlein/Desktop/univariate_probabilisticTransformer.py", line 89, in main
    outputs = model.generate(
  File "/Users/ricardokleinlein/Desktop/.venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/ricardokleinlein/Desktop/venv/lib/python3.9/site-packages/transformers/models/time_series_transformer/modeling_time_series_transformer.py", line 1819, in generate
    print(repeated_features[:, :, k+1].shape)
IndexError: index 3 is out of bounds for dimension 2 with size 3
```

Might be there an issue with the processing of different shapes? I'm facing the exact same error this issue was opened for, but in a case in which I'd need input_size to be 1 - and I'm not quite sure about how to proceed.

Thank you for your help!

### Reproduction

```
import torch
from transformers import TimeSeriesTransformerConfig, TimeSeriesTransformerForPrediction


batch_size = 32
context_length = 5
prediction_length = 3
input_size = 1
num_time_features = 1
lags_sequence = [1]

config = TimeSeriesTransformerConfig(prediction_length=prediction_length,
                                     context_length=context_length,
                                     input_size=input_size,
                                     lags_sequence=lags_sequence,
                                     num_time_features=num_time_features,
                                     num_static_categorical_features=0,
                                     num_static_real_features=0,
                                     num_dynamic_real_features=0,
                                     embedding_dimension=64,
                                     encoder_ffn_dim=32,
                                     decoder_ffn_dim=32,
                                     encoder_attention_heads=2,
                                     decoder_attention_heads=2,
                                     encoder_layers=2,
                                     decoder_layers=2,
                                     is_encoder_decoder=True,
                                     activation_function="gelu",
                                     d_model=64,
                                     dropout=0.1,
                                     encoder_layerdrop=0.1,
                                     decoder_layerdrop=0.1,
                                     attention_dropout=0.1,
                                     activation_dropout=0.1,
                                     num_parallel_samples=100,
                                     init_std=0.02
                                     )

model = TimeSeriesTransformerForPrediction(config)


# input past seq length is context_length plus largest lag value:
outputs = model.generate(past_values=torch.randn((batch_size, context_length+max(lags_sequence))),
                         past_time_features=torch.randn((batch_size, context_length+max(lags_sequence), num_time_features)),
                         past_observed_mask=torch.ones((batch_size, context_length+max(lags_sequence))),
                         future_time_features=torch.randn((batch_size, prediction_length, num_time_features)),
                         )

print(outputs.["sequences"].shape)
```

### Expected behavior

``outputs["sequences"].shape`` should be equal to ``torch.Size([32, 100, 3])``

Comments:
thanks ok @ricardokleinklein having a look now

Hi! I've been checking the example and my particular case, and seems it was a mistake from my side after all. Closing the issue - thank you!