dynamic_partition with dynamic num_partitions
<p>The variable <code>num_partitions</code> in the method <code>tf.dynamic_partition</code> is not a <code>Tensor</code>, but an <code>int</code>. 
Therefore, if the number of partitions isn't known in advance, it can't be inferred from the data by e.g., counting the number of unique values nor can't be given by a <code>tf.placeholder</code>.
How can one use this method in such a dynamic scenario?</p>

<p>If it's impossible, a plausible workaround is to set the value of this parameter to some upper bound. Then at running time there will be some empty lists. The question is how those empty lists can be eliminated?</p>

<p>Thanks!</p>