Higher Order Functions in TensorFlow - How to use?
<p>the new higher order functions within TF is detailed here:</p>

<p><a href="https://www.tensorflow.org/versions/r0.8/api_docs/python/functional_ops.html#map_fn" rel="nofollow">https://www.tensorflow.org/versions/r0.8/api_docs/python/functional_ops.html#map_fn</a></p>

<p>In particular, the map function looks useful. Here is what they wrote for the tutorial:</p>

<pre><code>  elems = [1, 2, 3, 4, 5, 6]
  squares = map_fn(lambda x: x * x, elems)
  # squares == [1, 4, 9, 16, 25, 36]
</code></pre>

<p>Thus I created an empty python file: </p>

<pre><code>import tensorflow as tf
elems = [1, 2, 3, 4, 5, 6]
squares = tf.map_fn(lambda x: x * x, elems)
</code></pre>

<p>Running this gives this error:</p>

<pre><code>/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.pyc in make_tensor_proto(values, dtype, shape)
    323   else:
    324     if values is None:
--&gt; 325       raise ValueError("None values not supported.")
    326     # if dtype is provided, forces numpy array to be the type
    327     # provided if possible.

ValueError: None values not supported.
</code></pre>

<p>Does anyone know what's going on? Thanks!</p>

<p>Edit: I'm using TensorFlow version 0.8.</p>