tf.SparseTensor
TensorFlow表示稀疏张量作为三个独立的密张量: indices
,values
,和dense_shape
。在Python中,三个张量被收集到一个SparseTensor
类中以便于使用。如果你有单独的 indices
,values
和dense_shape
张量,SparseTensor
在传递给下面的操作之前将它们包装在一个对象中。
具体地说,稀疏张量tf.SparseTensor(indices, values, dense_shape)
包括以下组件,其中N
和ndims
分别是值的数量和维度的数量