def write_array_to_checkpoint(var_name, array, checkpoint_path):
  """Writes Numpy array to TF checkpoint."""
  with tf.Graph().as_default():
    init_value = tf.py_func(lambda: array, [], tf.float32)
    init_value.set_shape(array.shape)
    var = tf.get_variable(var_name, initializer=init_value)
    saver = tf.train.Saver([var])
    with tf.Session() as session:
      session.run(tf.global_variables_initializer())
      saver.save(session, checkpoint_path)
Writes Numpy array to TF checkpoint.
language/realm/refresh_doc_embeds.py