class_docstr: Wrapper for tensorflow_datasets encoders.
  
  In the TFDS encoders, ID=0 is reserved for padding.
  We want to also reserve ID=1 for EOS, so we shift all IDs up by 1.
class_docstr_tok: ["Wrapper","for","tensorflow_datasets","encoders",".","In","the","TFDS","encoders",",","ID=0","is","reserved","for","padding",".","We","want","to","also","reserve","ID=1","for","EOS",",","so","we","shift","all","IDs","up","by","1","."]
docstr: Encode a python string as a list of integers.
  
  Args:
    s: a string
  Returns:
    a list of integers (not terminated by EOS)
docstr_tok: ["Encode","a","python","string","as","a","list","of","integers",".","Args",":","s",":","a","string","Returns",":","a","list","of","integers","(","not","terminated","by","EOS",")"]
code: def encode(self, s):
      """Encode a python string as a list of integers.
  
      Args:
        s: a string
      Returns:
        a list of integers (not terminated by EOS)
      """
      # shift IDs up by 1 to make room for EOS=1 (see class docstring)
      return [i + 1 for i in self._tfds_encoder.encode(s)]
  
file_path: mesh/mesh_tensorflow/transformer/vocabulary.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gin
  import tensorflow_datasets
label_desc: Use image node_id 3 for calling the TFDSVocabulary obj's underlying member method code with example usage: obj.encode(s) and returns: unknown