Skip to content

Commit 5f0701c

Browse files
committed
fix(attention_compressed): use min kwarg in jnp.clip
1 parent da39b01 commit 5f0701c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/maxtext/layers/attention_compressed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def __call__(
715715
# Clamp indices safely using jnp.clip to avoid JAX negative/out-of-bounds indexing exceptions
716716
# under indexer -1 sentinel conditions.
717717
# safe_indices: [B, S, k]
718-
safe_indices = jnp.clip(topk, a_min=0)
718+
safe_indices = jnp.clip(topk, min=0)
719719
# batch_idx: [B, 1, 1]
720720
batch_idx = jnp.arange(batch)[:, jnp.newaxis, jnp.newaxis]
721721
# Perform TPU-efficient JAX Advanced Indexing Gather.

0 commit comments

Comments
 (0)