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_reflect
def pad_reflect[rank: Int, dtype: DType, padding_type: DType](output: Pointer[Scalar[dtype]], output_shape: IndexList[rank], input: Pointer[Scalar[dtype]], input_shape: IndexList[rank], paddings: Pointer[Scalar[padding_type]], ctx: DeviceContextBase)
Fill output with values from input, and edges padded with reflected 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[reflect(x - x0), reflect(y - y0), reflect(z - z0)]Args:
- output (
Pointer[Scalar[dtype]]): The output buffer. - output_shape (
IndexList[rank]): The output shape. - input (
Pointer[Scalar[dtype]]): The input buffer. - input_shape (
IndexList[rank]): The input shape. - paddings (
Pointer[Scalar[padding_type]]): Ordered (before, after) padding sizes for each axis. - ctx (
DeviceContextBase): Device context for participating GPU.