從 SparseTensorsMap
中讀取 SparseTensors
並將它們連接起來。
用法
tf.raw_ops.TakeManySparseFromTensorsMap(
sparse_handles, dtype, container='', shared_name='',
name=None
)
參數
-
sparse_handles
Tensor
類型為int64
。 1-D,N
序列化SparseTensor
對象。形狀:[N]
。 -
dtype
一個tf.DType
。SparseTensor
對象的dtype
存儲在SparseTensorsMap
中。 -
container
可選的string
。默認為""
。此操作讀取的SparseTensorsMap
的容器名稱。 -
shared_name
可選的string
。默認為""
。此操作讀取的SparseTensorsMap
的共享名稱。它不應為空;而應該使用shared_name
或創建原始SparseTensorsMap
的操作的唯一操作名稱。 -
name
操作的名稱(可選)。
返回
-
Tensor
對象的元組(sparse_indices、sparse_values、sparse_shape)。 -
sparse_indices
Tensor
類型為int64
。 -
sparse_values
Tensor
類型為dtype
。 -
sparse_shape
Tensor
類型為int64
。
輸入 sparse_handles
必須是形狀為 [N, 1]
的 int64
矩陣,其中 N
是小批量大小,行對應於 AddSparseToTensorsMap
或 AddManySparseToTensorsMap
的輸出句柄。進入給定輸入操作的原始SparseTensor
對象的等級必須全部匹配。當最終的 SparseTensor
創建時,它的排名比傳入的 SparseTensor
對象的排名高一級(它們已沿左側的新行維度連接)。
輸出SparseTensor
對象的所有維度的形狀值,但第一個是輸入SparseTensor
對象對應維度的形狀值的最大值。它的第一個形狀值是 N
,即小批量大小。
假設輸入SparseTensor
對象的索引按標準字典順序排序。如果不是這種情況,則在此步驟之後運行SparseReorder
以恢複索引順序。
例如,如果句柄表示一個輸入,它是一個 [2, 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.Tanh用法及代碼示例
- Python tf.raw_ops.Tan用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.TensorScatterMax用法及代碼示例
- Python tf.raw_ops.TensorScatterSub用法及代碼示例
- Python tf.raw_ops.TensorArrayConcatV3用法及代碼示例
- Python tf.raw_ops.TopKV2用法及代碼示例
- Python tf.raw_ops.Tile用法及代碼示例
- Python tf.raw_ops.TPUReplicatedOutput用法及代碼示例
- Python tf.raw_ops.TensorScatterAdd用法及代碼示例
- Python tf.raw_ops.TensorArraySplitV3用法及代碼示例
- Python tf.raw_ops.TopK用法及代碼示例
- Python tf.raw_ops.TensorScatterUpdate用法及代碼示例
- 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.TakeManySparseFromTensorsMap。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。