減去對變量引用的稀疏更新。
用法
tf.raw_ops.ScatterSub(
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.raw_ops.ScatterUpdate用法及代碼示例
- Python tf.raw_ops.ScatterNdUpdate用法及代碼示例
- Python tf.raw_ops.ScatterAdd用法及代碼示例
- Python tf.raw_ops.ScatterDiv用法及代碼示例
- Python tf.raw_ops.ScatterNdSub用法及代碼示例
- Python tf.raw_ops.ScatterNdNonAliasingAdd用法及代碼示例
- Python tf.raw_ops.ScatterMul用法及代碼示例
- Python tf.raw_ops.ScatterMin用法及代碼示例
- Python tf.raw_ops.ScatterNdAdd用法及代碼示例
- Python tf.raw_ops.ScatterNd用法及代碼示例
- Python tf.raw_ops.ScatterMax用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.Size用法及代碼示例
- Python tf.raw_ops.SparseCrossV2用法及代碼示例
- Python tf.raw_ops.Sub用法及代碼示例
- Python tf.raw_ops.SparseCross用法及代碼示例
- Python tf.raw_ops.SegmentMean用法及代碼示例
- Python tf.raw_ops.StringStrip用法及代碼示例
- Python tf.raw_ops.SparseConcat用法及代碼示例
- Python tf.raw_ops.SparseSegmentSumWithNumSegments用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.ScatterSub。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
