減去對變量引用的稀疏更新。
用法
tf.compat.v1.scatter_sub(
ref, indices, updates, use_locking=False, name=None
)參數
-
ref一個可變的Tensor。必須是以下類型之一:float32,float64,int32,uint8,int16,int8,complex64,int64,qint8,quint8,qint32,bfloat16,uint16,complex128,half,uint32,uint64。應該來自Variable節點。 -
indices一個Tensor。必須是以下類型之一:int32,int64。ref第一維的索引張量。 -
updates一個Tensor。必須與ref具有相同的類型。要從ref中減去的更新值的張量。 -
use_locking可選的bool。默認為False。如果為True,減法將被鎖保護;否則行為是未定義的,但可能表現出較少的爭用。 -
name操作的名稱(可選)。
返回
-
一個可變的
Tensor。具有與ref相同的類型。
# Scalar indices
ref[indices, ...] -= updates[...]
# Vector indices (for each i)
ref[indices[i], ...] -= updates[i, ...]
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
此操作在更新完成後輸出ref。這使得鏈接需要使用重置值的操作更容易。
正確處理重複條目:如果多個 indices 引用相同的位置,則它們的(否定的)貢獻添加。
需要 updates.shape = indices.shape + ref.shape[1:] 或 updates.shape = [] 。
相關用法
- Python tf.compat.v1.scatter_min用法及代碼示例
- 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_mul用法及代碼示例
- Python tf.compat.v1.scatter_nd_update用法及代碼示例
- Python tf.compat.v1.scatter_nd_add用法及代碼示例
- Python tf.compat.v1.scatter_max用法及代碼示例
- 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_sub。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
