Mojo function
pad_repeat
pad_repeat[dtype: DType, paddings_type: DType](output: TileTensor[dtype, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size], input: TileTensor[dtype, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size], paddings: UnsafePointer[Scalar[paddings_type]])
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:
- βdtype (
DType): DType of the input/output buffer. - βpaddings_type (
DType): DType of the input, output, and padding buffers.
Args:
- βoutput (
TileTensor[dtype, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size]): The output buffer. - βinput (
TileTensor[dtype, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size]): The input buffer. - βpaddings (
UnsafePointer[Scalar[paddings_type]]): Ordered (before, after) padding sizes for each axis.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!