jax.lax.scatter_mul#
- jax.lax.scatter_mul(operand, scatter_indices, updates, dimension_numbers, *, indices_are_sorted=False, unique_indices=False, mode=None)[原始碼]#
分散-乘法運算子。
包裝 XLA 的 Scatter 運算子,其中乘法用於組合更新與來自 operand 的數值。
scatter 的語意相當複雜,其 API 未來可能會變更。對於大多數使用案例,您應該偏好 JAX 陣列上的
jax.numpy.ndarray.at
屬性,它使用熟悉的 NumPy 索引語法。- 參數:
operand (ArrayLike) – 要套用分散運算的陣列
scatter_indices (ArrayLike) – 提供 operand 中索引的陣列,每個 updates 中的更新值應套用至這些索引。
updates (ArrayLike) – 應分散到 operand 上的更新值。
dimension_numbers (ScatterDimensionNumbers) – lax.ScatterDimensionNumbers 物件,描述 operand、start_indices、updates 和輸出的維度如何關聯。
indices_are_sorted (bool) – scatter_indices 是否已知已排序。若為 true,可能會改善某些後端的效能。
unique_indices (bool) –
operand
中要更新的元素是否保證彼此不重疊。若為 true,可能會改善某些後端的效能。JAX 不會檢查此承諾:如果當unique_indices
為True
時,更新的元素重疊,則行為未定義。mode (str | GatherScatterMode | None | None) – 如何處理超出邊界的索引:當設定為 ‘clip’ 時,索引會被鉗制,使切片在邊界內;當設定為 ‘fill’ 或 ‘drop’ 時,超出邊界的更新會被捨棄。當設定為 ‘promise_in_bounds’ 時,超出邊界索引的行為由實作定義。
- 回傳:
包含 operand 和分散更新值總和的陣列。
- 回傳型別: