Your ctc_loss looks straightforward, so there shouldn’t be any issues.
In kl_tar:




 jinserk:

kl_inp = log_probs.transpose(0, 1)
kl_tar = torch.full_like(kl_inp, 1. / self.num_classes)



why are you using kl_inp (which uses input log_probs) for creating the kl_tar? Should it be dependent on the targets input instead?