I guess it might have been some problem with the Pycharm integrated development environment… I tried to write new commands on the console, but it kept telling the previous command was still running. Fortunately, I had saved everything in a dictionary, so I reloaded the data and this time the command took only a few seconds.
There is only a slight difference in my initial command:
GRU_100_Epochs = {
    'epochs': 100,
    'loss': loss_b,
    'prediction': y_pred_b,
    'target': Yp_train.cpu(),
    'inputs': Xp_train.cpu()}

and the latter case where I modified the dictionary entry, as follows:
GRU_100_Epochs['target'] = GRU_100_Epochs['target'].cpu()
GRU_100_Epochs['inputs'] = GRU_100_Epochs['inputs'].cpu()

EDIT: Xp_train and Yp_train are the tensor cuda objects.