title: How can I take the 2nd max from a Tensorflow tensor?
body: <p>Right now, my function uses argmax:</p>
  
  <pre><code> p = tf.stop_gradient(tf.argmax(prev, 1))
  </code></pre>
  
  <p>I have tried using the following, but the dimn are incompatible: </p>
  
  <pre><code> p = tf.stop_gradient(tf.nn.top_k(prev, 2)[1])
  
   raise ValueError("Linear is expecting 2D arguments: %s" % str(shapes))
   ValueError: Linear is expecting 2D arguments: [[None, 2, 1024], [None, 1024]]
  </code></pre>
  
  <p>My TF version might be 0.5, which is why top_k only has 2 args.</p>