"""Small shared helpers used by the astrojax kernel builders.
Centralises the multi-device sharding pattern so the per-task builders don't
each re-implement it. Drop-in replacement for the deprecated
``jax.device_put_sharded`` call.
"""
"""Shard the leading axis of ``array`` across ``devices`` using the modern
``jax.device_put`` + ``NamedSharding`` API.
``array.shape[0]`` must equal ``len(devices)``. The leading axis is
partitioned across the device mesh; every other axis is replicated.
Returns a sharded JAX array ready to feed into ``jax.pmap`` or
``jax.jit`` with a matching shape.
"""
=
=
=
return