根據 start 和 size 切片 SparseTensor 。
用法
tf.sparse.slice(
sp_input, start, size, name=None
)參數
-
sp_input要拆分的SparseTensor。 -
start一維。張量表示切片的開始。 -
size一維。張量表示切片的大小。 -
name操作的名稱(可選)。
返回
-
拚接產生的
SparseTensor對象。
拋出
-
TypeError如果sp_input不是SparseTensor。
例如,如果輸入是
input_tensor = shape = [2, 7]
[ a d e ]
[b c ]
從圖形上看,輸出張量是:
sparse.slice([0, 0], [2, 4]) = shape = [2, 4]
[ a ]
[b c ]
sparse.slice([0, 4], [2, 3]) = shape = [2, 3]
[ d e ]
[ ]
相關用法
- Python tf.sparse.split用法及代碼示例
- Python tf.sparse.softmax用法及代碼示例
- Python tf.sparse.segment_sum用法及代碼示例
- Python tf.sparse.sparse_dense_matmul用法及代碼示例
- Python tf.sparse.cross用法及代碼示例
- Python tf.sparse.mask用法及代碼示例
- 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.reduce_sum用法及代碼示例
- Python tf.sparse.to_indicator用法及代碼示例
- Python tf.sparse.from_dense用法及代碼示例
- Python tf.sparse.retain用法及代碼示例
- Python tf.sparse.minimum用法及代碼示例
- Python tf.sparse.reduce_max用法及代碼示例
- Python tf.sparse.fill_empty_rows用法及代碼示例
- Python tf.sparse.cross_hashed用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.sparse.slice。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
