import tensorflow as tf


        num_classes = self._hparams.num_classes
        is_binary = num_classes == 1
        is_binary = is_binary or (num_classes <= 0 and logits.shape[1] == 1)

        if is_binary:
            pred = tf.greater(logits, 0)
            logits = tf.reshape(logits, [-1])
        else:
            pred = tf.argmax(logits, 1)
        pred = tf.cast(tf.reshape(pred, [-1]), tf.int64)

