code: def dict_to_example(dictionary):
    
    features = {}
    for k, v in six.iteritems(dictionary):
      features[k] = tf.train.Feature(int64_list=tf.train.Int64List(value=v))
    return tf.train.Example(features=tf.train.Features(feature=features))
docs: Converts a dictionary of string->int to a tf.Example.