code: def sparse_matrix_to_tf_sparse_tensor(matrix):
      """Convert scipy sparse matrix to `tf.sparse.SparseTensor`."""
      sp_matrix = matrix.tocoo().astype(np.float32)
      indices = tf.convert_to_tensor(
          np.vstack((sp_matrix.row, sp_matrix.col)).T.astype(np.int64)
      )
      values = tf.convert_to_tensor(sp_matrix.data)
      shape = tf.TensorShape(sp_matrix.shape)
      return tf.sparse.SparseTensor(indices, values, shape)
  
file_path: neural-structured-learning/research/gnn-survey/utils.py
imports: import os
  from models import GAT
  from models import GCN
  from models import GIN
  import numpy
  import scipy.sparse
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: sparse_matrix_to_tf_sparse_tensor(matrix) and returns: tf