將 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
