import tensorflow as tf

    next_indices = tf.stack([neighbor.indices[:, 0], next_idx], 1)
    next_values = weight.values
    next_shape = [tf.size(nodes), tf.size(next_nodes)]
    next_adj = tf.sparse.SparseTensor(next_indices, next_values, next_shape)
