Hi, all,
Well, I propose this solution, which it not as “elegant” as I would like.
In evaluation mode, I’m copying the output of the recurrent iterations on a temporal tensor. Then, I use this tensor as input for training…
# copy on _x the outputs of the recurrent evaluation
_x = x.clone().detach()
net.eval()
with torch.no_grad():
    for t in range(seqlen):
        xt = x[:,t,:].clone().detach().squeeze()
        if t < seqlen-predtmp:
            h_t, c_t = net(xt, h_t, c_t)
            out = fc(h_t)
        else:
            dout = out.clone().detach()
            _x[:,t,3:] = dout
            xt[:,3:] = dout
            h_t, c_t = net(xt, h_t, c_t)
            out = fc(h_t)

h_t, c_t = (torch.zeros(batch_size, hidden_size), 
        torch.zeros(batch_size, hidden_size))
net.train()
for t in range(seqlen):
    xt = _x[:,t,:].clone().detach().squeeze()
    h_t, c_t = net(xt, h_t, c_t)
    out = fc(h_t)

loss = l1_loss(out, y)
loss.backward()

I hope this help to someone in the same situation.
Bye!!