def sample(self): u = tf.random_uniform(tf.shape(self.logits)) return tf.argmax(self.logits - tf.log(-tf.log(u)), axis=1)