Skip to main content

Mojo function

pad_reflect

pad_reflect[dtype: DType, paddings_type: DType](output: TileTensor[dtype, LayoutType, origin, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], input: TileTensor[dtype, LayoutType, origin, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], paddings: UnsafePointer[Scalar[paddings_type], origin])

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

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

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

Args:

  • โ€‹output (TileTensor): The output buffer.
  • โ€‹input (TileTensor): The input buffer.
  • โ€‹paddings (UnsafePointer): Ordered (before, after) padding sizes for each axis.

Was this page helpful?