import torch


def predict(model, device, test_inputs, future_predictions_size: int, train_window_size: int):
    """Prediction based on model.

    Args:
        model: Already trainded model.
        device: Device on which a `torch.Tensor` is or will be allocated.
        test_inputs: Input sequence.
        future_predictions_size: Size of the predictions.
        train_window_size: Size of the window.
    """
    predictions = test_inputs.copy()

    for i in range(future_predictions_size):
        seq = torch.FloatTensor(predictions[-train_window_size:]).to(device)
        with torch.no_grad():
            model.hidden = (
                torch.zeros(1, 1, model.hidden_size).to(device),
                torch.zeros(1, 1, model.hidden_size).to(device)
            )
            predictions.append(model(seq).item())

    predictions = predictions[-train_window_size:]
    
    return predictions