將稀疏更新應用於獲取元素最大值的張量。
用法
tf.raw_ops.TensorScatterMax(
tensor, indices, updates, name=None
)參數
-
tensor一個Tensor。要更新的張量。 -
indices一個Tensor。必須是以下類型之一:int32,int64。索引張量。 -
updates一個Tensor。必須與tensor具有相同的類型。更新分散到輸出中。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與tensor相同的類型。
返回從 tensor 複製的新張量,其值是張量和根據索引更新之間的元素最大值。
tensor = [0, 0, 0, 0, 0, 0, 0, 0]
indices = [[1], [4], [5]]
updates = [1, -1, 1]
tf.tensor_scatter_nd_max(tensor, indices, updates).numpy()
array([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32)
有關詳細信息,請參閱tf.tensor_scatter_nd_update。
相關用法
- Python tf.raw_ops.TensorScatterSub用法及代碼示例
- Python tf.raw_ops.TensorScatterAdd用法及代碼示例
- Python tf.raw_ops.TensorScatterUpdate用法及代碼示例
- Python tf.raw_ops.TensorArrayConcatV3用法及代碼示例
- Python tf.raw_ops.TensorArraySplitV3用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Tanh用法及代碼示例
- Python tf.raw_ops.TakeManySparseFromTensorsMap用法及代碼示例
- Python tf.raw_ops.TopKV2用法及代碼示例
- Python tf.raw_ops.Tile用法及代碼示例
- Python tf.raw_ops.TPUReplicatedOutput用法及代碼示例
- Python tf.raw_ops.Tan用法及代碼示例
- Python tf.raw_ops.TopK用法及代碼示例
- 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.TensorScatterMax。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
