使用min 操作將稀疏更新減少到變量引用中。
用法
tf.compat.v1.scatter_min(
ref, indices, updates, use_locking=False, name=None
)參數
-
ref一個可變的Tensor。必須是以下類型之一:half,bfloat16,float32,float64,int32,int64。應該來自Variable節點。 -
indices一個Tensor。必須是以下類型之一:int32,int64。ref第一維的索引張量。 -
updates一個Tensor。必須與ref具有相同的類型。要減少為ref的更新值的張量。 -
use_locking可選的bool。默認為False。如果為 True,則更新將受鎖保護;否則行為是未定義的,但可能表現出較少的爭用。 -
name操作的名稱(可選)。
返回
-
一個可變的
Tensor。具有與ref相同的類型。
該操作計算
# Scalar indices
ref[indices, ...] = min(ref[indices, ...], updates[...])
# Vector indices (for each i)
ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...],
updates[i, ..., j, ...])
此操作在更新完成後輸出ref。這使得鏈接需要使用重置值的操作更容易。
正確處理重複條目:如果多個 indices 引用相同的位置,則它們的貢獻合並。
需要 updates.shape = indices.shape + ref.shape[1:] 或 updates.shape =
[] 。
相關用法
- Python tf.compat.v1.scatter_mul用法及代碼示例
- Python tf.compat.v1.scatter_max用法及代碼示例
- Python tf.compat.v1.scatter_add用法及代碼示例
- Python tf.compat.v1.scatter_div用法及代碼示例
- Python tf.compat.v1.scatter_update用法及代碼示例
- Python tf.compat.v1.scatter_nd_sub用法及代碼示例
- Python tf.compat.v1.scatter_sub用法及代碼示例
- Python tf.compat.v1.scatter_nd_update用法及代碼示例
- Python tf.compat.v1.scatter_nd_add用法及代碼示例
- Python tf.compat.v1.scalar_mul用法及代碼示例
- Python tf.compat.v1.scan用法及代碼示例
- Python tf.compat.v1.strings.length用法及代碼示例
- Python tf.compat.v1.summary.merge用法及代碼示例
- Python tf.compat.v1.size用法及代碼示例
- Python tf.compat.v1.summary.FileWriter用法及代碼示例
- Python tf.compat.v1.space_to_batch用法及代碼示例
- Python tf.compat.v1.string_split用法及代碼示例
- Python tf.compat.v1.squeeze用法及代碼示例
- Python tf.compat.v1.set_random_seed用法及代碼示例
- Python tf.compat.v1.sparse_to_dense用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.scatter_min。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
