How to prevent Tensorflow unpack() method casting to float64
<p>I'm trying to set up a sequential RNN in Tensorflow with seq2seq.rnn_decoder().  The input that rnn_decoder() wants is a list of tensors, so to generate this I've passed in a rank-3 tensor and used tf.unpack() to make it into a list.  The problem arises when the float32 array that I pass in in turned into a float64 tensor by tf.unpack(), making it incompatible with the rest of the model.   Here's the code I put together to convince me that the culprit is tf.unpack():</p>

<pre><code>inputDat = loader.getSequential(BATCH_SIZE)
print(inputDat.shape)
</code></pre>

<p>output (BATCH_SIZE is five, sequence length is ten):</p>

<pre><code>(10, 5, 3)
</code></pre>

<p>Then I can load this data in a Tensorflow session:</p>

<pre><code>sess = tf.InteractiveSession()
input_tensor = tf.constant(inputDat.astype('float32'), dtype=tf.float32)
print "Input tensor type: " + str(type(input_tensor.eval()[0,0,0]))
input_tensor = tf.unpack(inputDat)
print "Input tensor shape: " + str(len(input_tensor)) + "x" + str(input_tensor[0].eval().shape)
print "Input tensor type: " + str(type(input_tensor[0].eval()[0,0]))
</code></pre>

<p>Output:</p>

<pre><code>Input tensor type: &lt;type 'numpy.float32'&gt;
Input tensor shape: 10x(5, 3)
Input tensor type: &lt;type 'numpy.float64'&gt;
</code></pre>

<p>What's going on here?   Using a FOR loop to iterate through each of the sequential entries and re-cast it seems like the wrong way to do this, and I can't find a method inside Tensorflow to cast every member of a list.</p>