For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
pad_repeat
def pad_repeat[dtype: DType, padding_type: DType](output: MutPointer[Scalar[dtype]], output_shape: Coord[*output_shape.element_types], input: ImmPointer[Scalar[dtype]], input_shape: Coord[*input_shape.element_types], paddings: ImmPointer[Scalar[padding_type]], ctx: DeviceContext)
Fill output with values from input, and edges padded with the boundary values from the unpadded region.
Example:
var input_shape = (X, Y, Z)
var paddings = [x0, x1, y0, y1, z0, z1]
out[x, y, z] =
input[clamp(x - x0), clamp(y - y0), clamp(z - z0)]Args:
- output (
MutPointer[Scalar[dtype]]): The output buffer. - output_shape (
Coord[*output_shape.element_types]): The output shape. - input (
ImmPointer[Scalar[dtype]]): The input buffer. - input_shape (
Coord[*input_shape.element_types]): The input shape. - paddings (
ImmPointer[Scalar[padding_type]]): Ordered (before, after) padding sizes for each axis. - ctx (
DeviceContext): Device context for participating GPU.