Do the random input tensors and ground truths tensors include blank labels ?
Then that seems to be the problem, CTC must find the blank labels and they should not be defined in the target tensor.
Also the target tensor must have size equal or smaller than the output probabilities