helion.language.atomic_min

helion.language.atomic_min(target, index, value, sem='relaxed')[source]

Atomically update target[index] with the minimum of current value and value.

Parameters:
  • target (Tensor) – Tensor to update.

  • index (list[object]) – Indices selecting elements to update. Can include tiles.

  • value (Tensor | float) – Value(s) to compare with.

  • sem (str) – Memory ordering semantics. One of "relaxed", "acquire",

  • "release"

  • "relaxed". ("acq_rel". Defaults to)

Returns:

The previous value(s) stored at target[index] before the update.

Return type:

torch.Tensor