jax.pallas.tpu_sc.unpack

Contents

jax.pallas.tpu_sc.unpack#

jax.pallas.tpu_sc.unpack(ab, /, *, format, preferred_element_type=None)[source]#

Unpacks two arrays according to the given format.

Warning

This is a temporary low-level API, which only works with needs_layout_passes=False. Use jax.lax.convert_element_type() or jax.Array.astype() instead. It will be removed once the SparseCore compiler is able to do packing/unpacking automatically.

Parameters:
  • ab (Array) – The array to unpack.

  • format (PackFormat) – The packing format to use.

  • preferred_element_type (str | type[Any] | dtype | SupportsDType | None) – Optional. The preferred element type of the unpacked arrays. If specified, must have double the bitwidth of the input array type.

Returns:

The unpacked arrays.

Return type:

tuple[Array, Array]