class_docstr: Abstract class for encoding strings as lists of integers.
  
  We will subclass this and wrap multiple implementations of text encoders.
  We follow the convention that ids 0=PAD and 1=EOS are reserved.
class_docstr_tok: ["Abstract","class","for","encoding","strings","as","lists","of","integers",".","We","will","subclass","this","and","wrap","multiple","implementations","of","text","encoders",".","We","follow","the","convention","that","ids","0=PAD","and","1=EOS","are","reserved","."]
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)
      """
      raise NotImplementedError("Not implemented.")
  
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 2 for calling the Vocabulary obj's underlying member method code with example usage: obj.encode(s) without return types