jax.experimental.pallas.BoundedSlice

jax.experimental.pallas.BoundedSlice#

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

Slices a dynamic-length window up to block_size along a dimension.

index_map must return a pl.Slice / pl.ds whose start and size may be dynamic, with size <= block_size. The kernel Ref has static size block_size, with valid elements at [:size] and undefined values past size.

block_shape=(BoundedSlice(3), 4), index_map -> (pl.ds(start=1, size=2), 0)
  array (4, 4):          ref (3, 4):
    . . . .                a b c d
    a b c d         ->     e f g h
    e f g h                ? ? ? ?   (?: undefined)
    . . . .
Parameters:

block_size (int)

__init__(block_size)#
Parameters:

block_size (int)

Return type:

None

Methods

__init__(block_size)

Attributes

block_size