tensorflow constant with variable size
<p>I have a variable batch size, so all of my inputs are of the form</p>

<pre><code>tf.placeholder(tf.float32, shape=(None, ...)
</code></pre>

<p>to accept the variable batch sizes. However, how might you create a constant value with variable batch size? The issue is with this line:</p>

<pre><code>log_probs = tf.constant(0.0, dtype=tf.float32, shape=[None, 1])
</code></pre>

<p>It is giving me an error:</p>

<pre><code>TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
</code></pre>

<p>I'm sure it is possible to initialize a constant tensor with variable batch size, how might I do so?</p>

<p>I've also tried the following:</p>

<pre><code>tf.constant(0.0, dtype=tf.float32, shape=[-1, 1])
</code></pre>

<p>I get this error:</p>

<pre><code>ValueError: Too many elements provided. Needed at most -1, but received 1
</code></pre>