aimz.utils.data.ArrayLoader.pad_array#

ArrayLoader.pad_array(x, n_pad, axis=0)[source]#

Pad an array to ensure compatibility with sharding.

Parameters:
  • x (Array | npt.NDArray) – The input array to be padded.

  • n_pad (int) – The number of padding elements to add.

  • axis (int) – The axis along which to apply the padding.

Returns:

The padded array with padding applied along the specified axis.

Raises:

ValueError – If padding is requested along an unsupported axis for a 1D array.

Return type:

Array | npt.NDArray