用默認值填充輸入 2-D SparseTensor 中的空行。
用法
tf.raw_ops.SparseFillEmptyRows(
indices, values, dense_shape, default_value, name=None
)參數
-
indicesTensor類型為int64。二維。稀疏張量的索引。 -
values一個Tensor。一維。稀疏張量的值。 -
dense_shapeTensor類型為int64。一維。稀疏張量的形狀。 -
default_value一個Tensor。必須與values具有相同的類型。 0-D。對於輸入稀疏張量中缺少的行,插入位置[row, 0, ..., 0]的默認值。輸出 index :2-D。填充稀疏張量的索引。 -
name操作的名稱(可選)。
返回
-
Tensor對象的元組(output_indices、output_values、empty_row_indicator、reverse_index_map)。 -
output_indicesTensor類型為int64。 -
output_values一個Tensor。具有與values相同的類型。 -
empty_row_indicatorTensor類型為bool。 -
reverse_index_mapTensor類型為int64。
輸入 SparseTensor 通過輸入元組 (indices , values , dense_shape) 表示。輸出 SparseTensor 具有相同的 dense_shape 但具有索引 output_indices 和值 output_values 。
此操作為沒有任何值的每一行插入一個條目。索引創建為 [row, 0, ..., 0] ,插入的值為 default_value 。
例如,假設 sp_input 具有形狀 [5, 6] 和非空值:
[0, 1]:a
[0, 3]:b
[2, 0]:c
[3, 1]:d
第 1 行和第 4 行為空,因此輸出的形狀為 [5, 6],其值:
[0, 1]:a
[0, 3]:b
[1, 0]:default_value
[2, 0]:c
[3, 1]:d
[4, 0]:default_value
輸出 SparseTensor 將按行優先順序排列,並具有與輸入相同的形狀。
此操作還返回一個形狀為 [dense_shape[0]] 的指示向量,使得
empty_row_indicator[i] = True iff row i was an empty row.
以及在反向傳播期間使用的反向索引圖矢量形狀[indices.shape[0]],
reverse_index_map[j] = out_j s.t. indices[j,:] == output_indices[out_j,:]
相關用法
- Python tf.raw_ops.SparseCrossV2用法及代碼示例
- Python tf.raw_ops.SparseCross用法及代碼示例
- Python tf.raw_ops.SparseConcat用法及代碼示例
- Python tf.raw_ops.SparseSegmentSumWithNumSegments用法及代碼示例
- Python tf.raw_ops.SparseMatrixSparseMatMul用法及代碼示例
- Python tf.raw_ops.SparseMatrixOrderingAMD用法及代碼示例
- Python tf.raw_ops.SparseSlice用法及代碼示例
- Python tf.raw_ops.SparseToDense用法及代碼示例
- Python tf.raw_ops.SparseSplit用法及代碼示例
- Python tf.raw_ops.SparseMatrixSparseCholesky用法及代碼示例
- Python tf.raw_ops.SparseSegmentSum用法及代碼示例
- Python tf.raw_ops.SparseMatrixMatMul用法及代碼示例
- Python tf.raw_ops.SparseCrossHashed用法及代碼示例
- Python tf.raw_ops.SpaceToDepth用法及代碼示例
- Python tf.raw_ops.SpaceToBatch用法及代碼示例
- Python tf.raw_ops.SpaceToBatchND用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.Size用法及代碼示例
- Python tf.raw_ops.ScatterUpdate用法及代碼示例
- Python tf.raw_ops.ScatterNdUpdate用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.SparseFillEmptyRows。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
