title: When there are some zeros in input vector, run the biLstm model will get a 'floating error 8'
body: <p>I do the padding process by myself, so there some 0 values in 'debate', 'reason', 'claim' or 'warrant'. Put into the BiLSTM architecture will get the 'floating error 8' without any other reminder. </p>
  
  <p>This error means some numbers divide by 0 or the index is out of range.</p>
  
  <p>but in the model, there shouldn't be any number divided by 0.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>debate = tf.placeholder(tf.float32,[None,48,300])
  reason = tf.placeholder(tf.float32,[None,48,300])
  claim = tf.placeholder(tf.float32,[None,48,300])
  warrant = tf.placeholder(tfenter code here.float32,[None,48,300])
  y = tf.placeholder(tf.float32,[None,2])
  
  n_hidden = 300
  
  w = weight_variable([n_hidden,2])
  b = bias_variable([2])
  def bilstm(x, weights, biases):
  
      lstm_f = tf.contrib.rnn.LSTMCell(n_hidden, forget_bias = 1.0)
      lstm_b = tf.contrib.rnn.LSTMCell(n_hidden, forget_bias = 1.0)
  
      (alloutputs, output_states) = tf.nn.bidirectional_dynamic_rnn(lstm_f, lstm_b, x, dtype = tf.float32)
      (outputs, state) = output_states
      (output_state_fw, output_state_bw) = state
  
      return tf.matmul(tf.add(output_state_fw, output_state_bw), weights) + biases
  final_representation = tf.concat([debate,reason,claim,warrant],1)
  
  prediction = bilstm(final_representation,w,b)
  
  cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,logits=prediction))
  
  train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
  </code></pre>
  
  <p>When I put the same input into the normal RNN architecture, it could work.
  Here is the RNN code which could run.</p>
  
  <pre><code>def RNN(X,weights,biases):
      lstm_cell = tf.nn.rnn_cell.LSTMCell(n_hidden,use_peepholes=True)
      #final_state[0] cell state
      #final_state[1] hidden_state
      outputs,final_state = tf.nn.dynamic_rnn(lstm_cell,X,dtype=tf.float32)
      results = tf.nn.softmax(tf.matmul(final_state[1],weights)+biases)
      return results
  </code></pre>
  
  <p>Could anyone tell me what happened? Did I misunderstand biLSTM model? There should not be any number divided by 0 in biLSTM!</p>
  
  <p>Thanks in advance.</p>