def write_sparse_tensor_dict(
    output_file,
    sparse_tensor_dict):
  """Write a dictionary of tf.SparseTensor values to a file.

  Args:
    output_file: Filename string or FileLike object.
    sparse_tensor_dict: Map from relation name to tf.SparseTensor values.
  """
  relation_dict = {
      rel_name: _sparse_tensor_to_numpy_dict(sparse_tensor)
      for rel_name, sparse_tensor in sparse_tensor_dict.items()
  }
  _write_numpy_item(output_file, relation_dict)
Write a dictionary of tf.SparseTensor values to a file.

  Args:
    output_file: Filename string or FileLike object.
    sparse_tensor_dict: Map from relation name to tf.SparseTensor values.
  
language/nql/nql/io.py