Determining if A Value is in a Set in TensorFlow
<p>The <code>tf.logical_or</code>, <code>tf.logical_and</code>, and <code>tf.select</code> functions are very useful.</p>

<p>However, suppose you have value <code>x</code>, and you wanted to see if it was in a <code>set(a, b, c, d, e)</code>. In python you would simply write:</p>

<pre><code>if x in set([a, b, c, d, e]):
  # Do some action.
</code></pre>

<p>As far as I can tell, the only way to do this in TensorFlow, is to have nested 'tf.logical_or' along with 'tf.equal'. I provided just one iteration of this concept below:</p>

<pre><code>tf.logical_or(
    tf.logical_or(tf.equal(x, a), tf.equal(x, b)),
    tf.logical_or(tf.equal(x, c), tf.equal(x, d))
)
</code></pre>

<p>I feel that there must be an easier way to do this in TensorFlow. Is there?</p>