fmassa:

loss = Criterion (…)(input, target, index)


can you expand this a bit i am struck with the same problem?
but constructing a tensor of all hypothesis for respective time-steps and using a criterion after the loop give very small gradients