jax.lax.scatter_min#

jax.lax.scatter_min(operand, scatter_indices, updates, dimension_numbers, *, indices_are_sorted=False, unique_indices=False, mode=None)[源代码]#

分散最小值(Scatter-min)运算符。

封装了 XLA的 Scatter 运算符,其中 min 函数用于组合来自 operand 的更新和值。

scatter 的语义很复杂,其 API 将来可能会更改。对于大多数用例,您应该优先使用 JAX 数组上的 jax.numpy.ndarray.at 属性,该属性使用熟悉的 NumPy 索引语法。

参数:
  • operand (ArrayLike) – 要应用分散操作的数组

  • scatter_indices (ArrayLike) – 一个数组,给出 operand 中应该应用 updates 中每个更新的索引。

  • updates (ArrayLike) – 应该分散到 operand 上的更新。

  • dimension_numbers (ScatterDimensionNumbers) – 一个 lax.ScatterDimensionNumbers 对象,描述 operandstart_indicesupdates 的维度以及输出如何关联。

  • indices_are_sorted (bool) – 是否已知 scatter_indices 是排序的。如果为 true,可能会提高某些后端上的性能。

  • unique_indices (bool) – 是否保证 operand 中要更新的元素彼此不重叠。如果为 true,可能会提高某些后端上的性能。JAX 不会检查此承诺:如果当 unique_indicesTrue 时更新的元素重叠,则行为是未定义的。

  • mode (str | GatherScatterMode | None | None) – 如何处理超出范围的索引:当设置为 ‘clip’ 时,索引将被限制,使切片在范围内;当设置为 ‘fill’ 或 ‘drop’ 时,超出范围的更新将被丢弃。当设置为 ‘promise_in_bounds’ 时,超出范围的索引的行为由实现定义。

返回:

一个包含 operand 和分散的更新之和的数组。

返回类型:

数组