将 SparseTensor 重新排序为规范的行优先排序。
用法
tf.sparse.reorder(
sp_input, name=None
)参数
-
sp_input输入SparseTensor。 -
name返回张量的名称前缀(可选)
返回
-
具有相同形状和非空值的
SparseTensor,但采用规范排序。
抛出
-
TypeError如果sp_input不是SparseTensor。
请注意,按照惯例,所有稀疏操作都沿增加的维数保留规范排序。唯一可能违反排序的时间是在手动操作索引和值以添加条目期间。
重新排序不会影响 SparseTensor 的形状。
例如,如果 sp_input 具有形状 [4, 5] 和 indices /values :
[0, 3]:b
[0, 1]:a
[3, 1]:d
[2, 0]:c
那么输出将是形状为 [4, 5] 和 indices /values 的 SparseTensor :
[0, 1]:a
[0, 3]:b
[2, 0]:c
[3, 1]:d
相关用法
- Python tf.sparse.reduce_sum用法及代码示例
- Python tf.sparse.retain用法及代码示例
- Python tf.sparse.reduce_max用法及代码示例
- Python tf.sparse.reshape用法及代码示例
- Python tf.sparse.cross用法及代码示例
- Python tf.sparse.mask用法及代码示例
- Python tf.sparse.split用法及代码示例
- Python tf.sparse.to_dense用法及代码示例
- Python tf.sparse.expand_dims用法及代码示例
- Python tf.sparse.maximum用法及代码示例
- Python tf.sparse.bincount用法及代码示例
- Python tf.sparse.concat用法及代码示例
- Python tf.sparse.transpose用法及代码示例
- Python tf.sparse.softmax用法及代码示例
- Python tf.sparse.to_indicator用法及代码示例
- Python tf.sparse.from_dense用法及代码示例
- Python tf.sparse.minimum用法及代码示例
- Python tf.sparse.segment_sum用法及代码示例
- Python tf.sparse.fill_empty_rows用法及代码示例
- Python tf.sparse.slice用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.sparse.reorder。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
