code: def sp_batch_to_sp_tensor(a_list):
      """
      Converts a list of Scipy sparse matrices to a rank 3 SparseTensor.
      :param a_list: list of Scipy sparse matrices with the same shape.
      :return: SparseTensor of rank 3.
      """
      tensor_data = []
      for i, a in enumerate(a_list):
          row, col, values = sp.find(a)
          batch = np.ones_like(col) * i
          tensor_data.append((values, batch, row, col))
      tensor_data = list(map(np.concatenate, zip(*tensor_data)))
  
      out = tf.SparseTensor(
          indices=np.array(tensor_data[1:]).T,
          values=tensor_data[0],
          dense_shape=(len(a_list),) + a_list[0].shape,
      )
  
      return out
  
imports: import numpy
  import tensorflow
  from scipy import sparse
label_desc: Use image node_id 4 for calling a global function with example usage: sp_batch_to_sp_tensor(a_list) and returns: out