Skip to main content
Log in

Mojo function

pad_repeat

pad_repeat[rank: Int, output_shape: DimList, input_shape: DimList, type: DType, paddings_type: DType](output: NDBuffer[type, rank, origin, output_shape], input: NDBuffer[type, rank, origin, input_shape], paddings: UnsafePointer[SIMD[paddings_type, 1]])

Fill output with values from input, and edges padded boundary values from the unpadded region.

Example: var input = [[1, 2], [3, 4]] var paddings = [2, 2, 1, 0]

Yields: output = [[1, 1, 2], [1, 1, 2], [1, 1, 2], [3, 3, 4], [3, 3, 4], [3, 3, 4]]

Parameters:

  • rank (Int): Rank of the input/output buffers.
  • output_shape (DimList): Dimensions of the output buffer.
  • input_shape (DimList): Dimensions of the input buffer.
  • type (DType): DType of the input/output buffer.
  • paddings_type (DType): DType of the input, output, and padding buffers.

Args:

  • output (NDBuffer[type, rank, origin, output_shape]): The output buffer.
  • input (NDBuffer[type, rank, origin, input_shape]): The input buffer.
  • paddings (UnsafePointer[SIMD[paddings_type, 1]]): Ordered (before, after) padding sizes for each axis.

Was this page helpful?