And what prevents you from doing it? 
go to the rows [55-60]:
for e in xrange(max_epoch):
for time in xrange(num_seqs):
h_next = model(input_gru[time], None)
err  = MSE_criterion(h_next [0], target_gru[time])
err. backward()