import tensorflow as tf


  def _TokenToString(self, token):
    return py_x_ops.vocab_id_to_token(token, vocab=self._pieces)

  def _StringToToken(self, tokstr):
    return tf.where(
        py_x_ops.token_in_vocab(tokstr, vocab=self._pieces),
        py_x_ops.vocab_token_to_id(tokstr, vocab=self._pieces),
        tf.broadcast_to(NO_TOKEN, tf.shape(tokstr)))

  def _MergeTokens(self, tokens):
    return self._StringToToken(
        self._TokenToString(tokens[0]) + self._TokenToString(tokens[1]))

  def _EncodeToIds(self, word):
    # Below:
