從序列化的小批量中反序列化並連接 SparseTensors。
用法
tf.raw_ops.DeserializeManySparse(
serialized_sparse, dtype, name=None
)參數
-
serialized_sparseTensor類型為string。 2-D,N序列化SparseTensor對象。必須有 3 列。 -
dtype一個tf.DType。序列化的SparseTensor對象的dtype。 -
name操作的名稱(可選)。
返回
-
Tensor對象的元組(sparse_indices、sparse_values、sparse_shape)。 -
sparse_indicesTensor類型為int64。 -
sparse_valuesTensor類型為dtype。 -
sparse_shapeTensor類型為int64。
輸入 serialized_sparse 必須是形狀為 [N x 3] 的字符串矩陣,其中 N 是小批量大小,行對應於 SerializeSparse 的打包輸出。原始SparseTensor 對象的等級必須全部匹配。創建最終的SparseTensor 時,它的排名比傳入的SparseTensor 對象的排名高一級(它們已沿新的行維度連接)。
輸出SparseTensor 對象的所有維度的形狀值,但第一個是輸入SparseTensor 對象對應維度的形狀值的最大值。它的第一個形狀值是 N ,即小批量大小。
假設輸入SparseTensor 對象的索引按標準字典順序排序。如果不是這種情況,則在此步驟之後運行SparseReorder 以恢複索引順序。
例如,如果序列化輸入是一個 [2 x 3] 矩陣,表示兩個原始 SparseTensor 對象:
index = [ 0]
[10]
[20]
values = [1, 2, 3]
shape = [50]
和
index = [ 2]
[10]
values = [4, 5]
shape = [30]
那麽最終反序列化的SparseTensor 將是:
index = [0 0]
[0 10]
[0 20]
[1 2]
[1 10]
values = [1, 2, 3, 4, 5]
shape = [2 50]
相關用法
- Python tf.raw_ops.DeserializeSparse用法及代碼示例
- Python tf.raw_ops.DecodeGif用法及代碼示例
- Python tf.raw_ops.DepthToSpace用法及代碼示例
- Python tf.raw_ops.DepthwiseConv2dNative用法及代碼示例
- Python tf.raw_ops.Dequantize用法及代碼示例
- Python tf.raw_ops.DecodeProtoV2用法及代碼示例
- Python tf.raw_ops.Dilation2D用法及代碼示例
- Python tf.raw_ops.DynamicPartition用法及代碼示例
- Python tf.raw_ops.DataFormatVecPermute用法及代碼示例
- Python tf.raw_ops.DiagPart用法及代碼示例
- Python tf.raw_ops.Diag用法及代碼示例
- Python tf.raw_ops.DynamicStitch用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.DeserializeManySparse。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
