mm.math.pad

math.pad(paddings, mode='CONSTANT', constant_values=0)

The padded array.

Parameters:
  • array (ndarray[Tuple[int, ...], Union[TypeVar(R, float16, float32, float64), TypeVar(C, complex64, complex128), TypeVar(Z, int16, int32, int64), TypeVar(N, uint16, uint32, uint64)]]) – The array to pad

  • paddings (tuple) – paddings to apply

  • mode (str) – mode to apply the padding

  • constant_values (int) – constant values to use for padding

Return type:

ndarray[Tuple[int, ...], Union[TypeVar(R, float16, float32, float64), TypeVar(C, complex64, complex128), TypeVar(Z, int16, int32, int64), TypeVar(N, uint16, uint32, uint64)]]

Returns:

The padded array