title: How to use tf.nn.ctc_loss in cnn+ctc network
body: <p>Recently, I try to use tensorflow to implement a cnn+ctc network base on the article <a href="https://arxiv.org/pdf/1701.02720.pdf" rel="nofollow noreferrer"><em>Towards End-to-End Speech Recognition with Deep Convolutional Neural Networks</em></a>.</p>
  
  <p>I try to feed batch spectrogram data (shape:(10,120,155,3),batch_size is 10) into 10 convolution layer and 3 fully connected layer. So the output before connecting the ctc layer is 2d data(shape:(10,1024)). </p>
  
  <p>Here is my problem: I want to use tf.nn.ctc_loss function in tensorflow library,but it generate the <em>ValueError: Dimension must be 2 but is 3 for 'transpose'(op:'Transpose') with input shapes:[?,1024],[3]</em>.</p>
  
  <p>I guess the error is related to the dimension of my 2d input data. The discription of the ctc_loss function in tensorflow official site is require a 3d input with the shape (batch_size x max_time x num_classes).</p>
  
  <p>So, what is the extra dimension of 'num_classes' ? what should I change the shape of my cnn+fc output data?</p>