jax.lax.pad(operand, padding_value, padding_config)[source]

Applies low, high, and/or interior padding to an array.

Wraps XLA’s Pad operator.

  • operand (Any) – an array to be padded.

  • padding_value (Any) – the value to be inserted as padding. Must have the same dtype as operand.

  • padding_config (Sequence[Tuple[int, int, int]]) – a sequence of (low, high, interior) tuples of integers, giving the amount of low, high, and interior (dilation) padding to insert in each dimension.

Return type



The operand array with padding value padding_value inserted in each dimension according to the padding_config.