将稀疏更新应用于获取元素最大值的张量。
用法
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
