title: Tensorflow: tf.rnn.raw_rnn - fn_loop not callable?
body: <p>I try to use a custom function for the loop_fn in an raw_rnn but there is this weird</p>
  
  <pre><code>"raise TypeError("loop_fn must be a callable")"  # Exception thrown?
  </code></pre>
  
  <p>Call:</p>
  
  <pre><code>callable_loop_fn = loop_fn(
      time=time,
      previous_output=None,
      previous_state=None,
      previous_loop_state=None,
      _W=W, _b=b,
      _decoder_lengths=decoder_lengths,
      _pad_step_embedded=pad_step_embedded,
      _eos_step_embedded=eos_step_embedded,
      _encoder_final_state=encoder_final_state)
  
  # using the functions for the attention decoder
  decoder_outputs_ta, decoder_final_state, decoder_loop_state = tf.nn.raw_rnn(decoder_cell, callable_loop_fn)
  </code></pre>
  
  <p>Definition:</p>
  
  <pre><code>def loop_fn(time, previous_output, previous_state, previous_loop_state, _W, _b, _decoder_lengths, _pad_step_embedded, _eos_step_embedded, _encoder_final_state):
  if previous_state is None:
      assert previous_output is None and previous_state is None
      return loop_fn_initial(_decoder_lengths, _eos_step_embedded, _encoder_final_state)
  else:
      return loop_fn_transition(time, previous_output, previous_state, previous_loop_state, _W, _b, _decoder_lengths, _pad_step_embedded)
  </code></pre>
  
  <p>Does someone know what this could be? I thought the function I provide is callable or did I understand something wrong?</p>