jax.experimental.pallas.Indirect

jax.experimental.pallas.Indirect#

class jax.experimental.pallas.Indirect(block_size)[source]#

Indexes a dimension via gather (for inputs) or scatter (for outputs).

index_map returns an Array or Ref of indices along this dimension, yielding an axis of size block_size in the kernel Ref.

block_shape=(Indirect(2), 4), index_map -> ([3, 0], 0)
  array (4, 4):          ref (2, 4):
    e f g h  (row 0)       a b c d   <- row 3
    . . . .         ->     e f g h   <- row 0
    . . . .
    a b c d  (row 3)
Parameters:

block_size (int)

__init__(block_size)#
Parameters:

block_size (int)

Return type:

None

Methods

__init__(block_size)

Attributes

block_size