code: def write_tfrecord_from_sparse_matrix(tfrecord_path, sparse_matrix):
      """
      Writes the contents of a sparse matrix to a TFRecord file.
      :param tfrecord_path: str
      :param sparse_matrix: scipy.sparse matrix
      :return: str
      The tfrecord path
      """
      dataset = create_tensorrec_dataset_from_sparse_matrix(
          sparse_matrix=sparse_matrix
      )
      return write_tfrecord_from_tensorrec_dataset(
          tfrecord_path=tfrecord_path, dataset=dataset
      )
  
file_path: tensorrec/tensorrec/input_utils.py
imports: import numpy
  from scipy import sparse
  import tensorflow
  from .session_management import get_session
label_desc: Use image node_id 3 for calling a global function with example usage: write_tfrecord_from_sparse_matrix(tfrecord_path, sparse_matrix) and returns: write_tfrecord_from_tensorrec_dataset