jax.pallas.tpu_sc.all_reduce_ffs

Contents

jax.pallas.tpu_sc.all_reduce_ffs#

jax.pallas.tpu_sc.all_reduce_ffs(x, *, reduce=1)[source]#

Computes the index of the first true element in the array.

Parameters:
  • x (Array) – A 1D array of bools.

  • reduce (int) – The factor to reduce the output shape by.

Returns:

An array with each element containing the index of the first true element in x or x.size if there are no true elements.

Return type:

Array