tfgnn supports RaggedTensor but, to the best of my knowledge, doesn't support SparseTensor. This can be tested like:
import tensorflow as tf
import tensorflow_gnn as tfgnn
ragged = tf.RaggedTensor.from_row_splits(values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8])
sparse = tf.SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], dense_shape=[3, 4])
tfgnn.NodeSet.from_fields(sizes=[5], features={"x": ragged})
# works fine: NodeSet(features={'x': <tf.RaggedTensor: dtype=tf.int32>}, sizes=[5])
tfgnn.NodeSet.from_fields(sizes=[3], features={"x": sparse})
# throws exception
The last line throws an exception like:
ValueError: Attempt to convert a value (SparseTensor(indices=tf.Tensor(
... with an unsupported type (<class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>) to a Tensor.
Is it possible for tfgnn to support SparseTensors? Are there plans for it?
tfgnn supports
RaggedTensorbut, to the best of my knowledge, doesn't supportSparseTensor. This can be tested like:The last line throws an exception like:
Is it possible for tfgnn to support
SparseTensors? Are there plans for it?