1. 功能
将updates的值,通过索引(indices)指定inputs对应位置上的值做比较取最小值(也就是更新inputs上对应的之)
2. 参数
ref:数据输入
indices:用来指定ref位置
updates:用来更新ref值的数据
注意:ref.shape >= indices.shape = updates.shape
3. 代码
import tensorflow as tf
"""
功能:
将updates的值,通过索引(indices)指定inputs对应位置上的值做比较取最小值(也就是更新inputs上对应的之)
主要参数:
ref:数据输入
indices:用来指定ref位置
updates:用来更新ref值的数据
"""
updates = tf.constant([3, 2, 5])
indices = tf.constant([0, 1, 1])
inputs = tf.Variable([6, 1, 7])
out_ = tf.raw_ops.ScatterMin(ref=inputs, indices=indices, updates=updates)
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
print(out_.eval())