import tensorflow as tf

            and type `tf.int64`. For binary classification, the standard \
            sigmoid function is used for prediction, and the class labels are \
            `{0, 1}`.
        """
        logits = self._encoder(inputs, sequence_length, dtype, mode)

        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)

        self._built = True

        return logits, pred

    @property
    def trainable_variables(self):
        """The list of trainable variables of the module.
        """
        if not self._built:
            raise TexarError(
                "Attempting to access trainable_variables before module %s "
