Mojo function
pad_repeat
pad_repeat[dtype: DType, paddings_type: DType](output: TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], input: TileTensor[dtype, LayoutType, origin, address_space=address_space, 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 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): The output buffer. - input (
TileTensor): The input buffer. - paddings (
UnsafePointer): 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!