How does the CTC loss work?
The paper Connectionist Temporal Classification: Labeling Unsegmented Sequence Data with Recurrent Neural Networks (2006), by Alex Graves et al., mentioned in the linked TensorFlow documentation, presents and explains the CTC loss and the CTC forward-backward algorithm (in section 4.1). 

Have also a look at this article Sequence Modeling With CTC (2017) by Awni Hannun.