def fetch_vocabulary_reserved_tokens(graph, name: str) -> Sequence[str]:
  """Fetches an evaluated reserved_tokens tensor for a vocabulary."""
  name_collection = graph.get_collection(_VOCABULARY_RESERVED_TOKENS_IDS)
  tokens_collection = graph.get_collection(_VOCABULARY_RESERVED_TOKENS)
  assert len(name_collection) == len(tokens_collection)
  tensor = tokens_collection[name_collection.index(name)]
  with tf.compat.v1.Session(graph=graph) as session:
    return session.run(tensor)
Fetches an evaluated reserved_tokens tensor for a vocabulary.
tensorflow_transform/tf_utils.py